Message Subfile

440 pts.
Tags:
Subfile
Hi, I am trying to implement message subfiles. But unable to process the code. Below is what my program does: 1. I have a Member Master (LMP001). I had built a Member maintenance Program which on calling shows the list of Members (Its a subfile) & corresponding fields. 2. When I take F9-Add on the Member maintenance it will show a display file (LMD003) which contains the fields to input the Member details - To add a New Member 3. I have created a message subfile included it as a new records in LMD003. 4. LMMSG & LMMSGCTL are the SFL and SFLCTL formats for the message subfile. 5. Now firstly I am trying to write the LMMSGCTL and then EXFMT on the display file (LMD003). When I am writing the LMMSGCTL it is showing permanent i/o error. I am trying to use a monitor but, in the on-error processing what code should be written to handle it? Or instead of monitor is there any better way to avoid this error? When I take F1 on the error message it reads the following: Message subfile error on file LMD003 in library Permanent I/O error occurred in file LMD003. Function check. RNX1251 unmonitored by LMR006 at statement 0000001200, instruction X'0000'. The below is the sequence: WRITE LMMSGCTL EXFMT LMD003R Am I missing something? Can anyone help me please.

Answer Wiki

Thanks. We'll let you know when a new response is added.
Please find my code below - This code is where I have implemented message sub file:

The below program is called from the subfile program when F9 is pressed.
LMD003 - Is the Add member details display file.
LMD003 - DDS: I have included only a part of the DDS where message subfiles record and control formats have been included.
 
  A		   DSPSIZ(24 80 *DS3)           
  A                                      CF03(03) 
  A          R LMMSG                     SFL
  A                                      SFLMSGRCD(24)       
  A            @KEY                      SFLMSGKEY           
  A            @PGMQ                     SFLPGMQ(10)         
  A          R LMMSGCTL                  SFLCTL(LMMSG)       
  A                                      SFLDSP               
  A                                      SFLDSPCTL           
  A                                      SFLINZ               
  A N03                                  SFLEND               
  A                                      SFLSIZ(0002)         
  A                                      SFLPAG(0001)         
  A            @PGMQ                     SFLPGMQ(10)         
  A          R LMD003R                                       

  A                                      OVERLAY             
  A                                  2 34'MEMBER DETAILS'     
  A                                      COLOR(WHT)           
  A                                  1 63DATE               
  A                                      EDTCDE(Y)             
  A                                  2 63TIME                 
  A                                  1  2USER                 
  A                                  8  9'MEMBER NAME:'       
  A                                  6  9'MEMBER ID:'         
  A                                 10  9'MEMBER ADDRESS:'   
  A                                 12  9'BOOKS TAKEN:'       
  A                                 14  9'BOOKS ALLOWED:'   

  Program:

HOPTION(*NODEBUGIO:*SRCSTMT)             
FLMD003    CF   E             WORKSTN    
 *                                       
DDATS             DS                     
D@STK                     1      4  0    
D@LEN                     5      8  0    
D@ERR                     9     12  0    
 *Write the message subfile              
C                   WRITE     LMMSGCTL   
 *Write and read the display file        
C                   EXFMT     LMD003R    
C                   EXSR      @CMD       
 *Clear the message subfile              
C                   MOVEL     *BLANKS       @KEY     
C                   CALL      'QMHRMVPM'    @PARM1   
 *Validate Member Name                               
C     MBRNAME       IFEQ      *BLANKS                
C                   MOVE      'MSG001'      @MSGID   
C                   CALL      'QMHSNDPM'    @PARM2   
C                   ENDIF                            
 *                                                   
 *Validate Member Address                            
C     MBRADDR       IFEQ      *BLANKS                
C                   MOVE      'MSG002'      @MSGID   
C                   CALL      'QMHSNDPM'    @PARM2   
C                   ENDIF                            
 *                                                   
 *Validate Maximum books taken                       
C     MBRTAKN       IFEQ      0                      
C                   MOVE      'MSG003'      @MSGID   
C                   CALL      'QMHSNDPM'    @PARM2   
 *Validate Maximum books Allowed                          
C     MBRMAXB       IFEQ      0                           
C                   MOVE      'MSG004'      @MSGID        
C                   CALL      'QMHSNDPM'    @PARM2        
C                   ENDIF                                 
 *Intialize sub routine                                   
C     *INZSR        BEGSR                                 
 *Specify the message file and Library into the 20 byte field
C                   MOVEL     '*LIBL'       @LIB    10     
C                   MOVE      '*LIBL'       @MSGF   20     
C                   MOVEL     'MSGF'        @MSGF            
*This parameter is used to clear the program queue   
C     @PARM1        PLIST                             
C                   PARM                    @PGMQ     
C                   PARM                    @STK      
C                   PARM                    @KEY      
C                   PARM                    @RMV           
C                   PARM                    @ERR                 
 *This parameter is used to send a message to the program queue  
C     @PARM2        PLIST                                        
C                   PARM                    @MSGID        7
C                   PARM                    @MSGF          
C                   PARM                    @DTA         80
C                   PARM                    @LEN          
C                   PARM                    @TYPE        10
C                   PARM                    @PGMQ          
C                   PARM                    @STK           
C                   PARM                    @KEY          
C                   PARM                    @ERR           
C                   ENDSR                                  
 *CMD Subroutine                                           
C     @CMD          BEGSR                                  
 *If F3 was pressed, set on LR and exit                    
C     *IN03         IFEQ      *ON 
C                   RETURN 
C                   ENDIF  
C                   ENDSR        
Regarding the question asked by Philip wrt to RRN - I have checked the RRN value during Debug. I see it is 3 (I am adding a 3rd member into the member file). Also, During Debug I get the error on LMMSGCTL.

Discuss This Question: 13  Replies

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
  • TomLiotta
    Am I missing something?   Probably. But we can't tell what it is because you didn't show us the programming code.   You can't tell us what you think your program is doing. You have to show us. If the program isn't working the way you think it should, then it's obviously doing something different from what you think. So, telling us doesn't help.   We don't have to see everything. Just parts that aren't working including any data definitions that are needed. Data definitions include program declares and DDS.   Tom
    125,585 pointsBadges:
    report
  • philpl1jb
    It seems like the error you are getting is based on the EXFMT of the subfile, not the write of the message file @ line 0012.00 .. error RNX1251 could be about anything.  Do you have a record in the subfile and the subfile RRN > 0? 
    49,550 pointsBadges:
    report
  • TomLiotta
    The error seems to be CPF5189 even though the OP didn't tell us what it was. But CPF5189 refers to an earlier message that isn't shown. CPF5189 points to the message subfile. Of course, it's all guesswork without seeing code. -- Tom
    125,585 pointsBadges:
    report
  • philpl1jb
    Looks like you are missing the logic to get your program module:
    d                SDS 
    d  @PGM                 001    010 
      
    49,550 pointsBadges:
    report
  • TomLiotta
    Odd... I didn't see the 'Answer' the last time I looked. Hard to figure how it could be missed with so much code. But it looks like Phil has a good probability. I don't see where the @PGMQ variable ever gets a value put into it before the LMMSGCTL format is written. The message subfile isn't being told which program message queue to pull messages from. -- Tom
    125,585 pointsBadges:
    report
  • juslikdat1
    Thanks for the response. But I am still facing the same issue.I have added the below 2 statements at the initialization:*Move * into the program queue field which tell the system to *use this programs message queue                              C*                  MOVE      '*'           @PGMQ  *To specify the message type to be diagnostic    C                   MOVEL     '*DIAG'       @TYPE 
    440 pointsBadges:
    report
  • TomLiotta
    I don't understand the code that you just posted.   The first MOVE statement appears to be a comment, so it has no purpose. The MOVE statement only changes the right-most byte anyway, so the result would probably be invalid and cause an error. It's not at all clear why anyone would use MOVE in that case.   The second MOVE statement would have similar problems. It will cause an error because the value for that parameter of QMHSNDPM cannot have the value that you put into @TYPE, so MOVE shouldn't be used as you used it. The QMHSNDPM API also wouldn't be directly related to the error for your message subfile. You could remove everything from your program that references the API and it wouldn't change anything about your subfile error.   Tom
    125,585 pointsBadges:
    report
  • philpl1jb
    Sorry, I left the Q off the variable name, @pgmQ.  Generally we load the @PGMQ variable with the program module name .. these d-specs get that name from the program data structure and load it into the variable @PGMQ.  This value is required.d                SDS d  @PGMQ                 001    010 or apparently this will workC        Eval          @PGMQ = '*'as Tom pointed out your move will move the * to the right side of the field.  If you feel that you must use move (but you really don't) it would be a movel (move left.C                 Movel    '*'     @PGMQIf you are using C specs to populate @PGMQ it must be populated before you use the message subfile.
    49,550 pointsBadges:
    report
  • philpl1jb
    Perhaps this will be formatted better, perhaps not  ...
    d                SDS 
    d  @PGMQ                 001    010 or 
    
    apparently this will workC        
    
    Eval          @PGMQ = '*'
    
    as Tom pointed out your move will move the * to the right side of the field.  If you feel that you must use move (but you really don't) it would be a movel (move left)
    
    .C                 Movel    '*'     @PGMQ
    
    If you are using C specs to populate @PGMQ it must be populated before you use the message subfile.
    49,550 pointsBadges:
    report
  • philpl1jb
    A bit more formatting and
    d                SDS  
    d  @PGMQ                 001    010 
    
    or  apparently this will work
    
    C                Eval          @PGMQ = '*' 
    
    as Tom pointed out your move will move the * to the right side of the field.  If you feel that you must use move (but you really don't) it would be a movel (move left) 
    
    .C                 Movel    '*'     @PGMQ 
    
      If you are using C specs to populate @PGMQ it must be populated before you use the message subfile. 
    
    49,550 pointsBadges:
    report
  • TomLiotta
    Note that even MOVEL will be a problem if @PGMQ is declared in the program status DS. -- Tom
    125,585 pointsBadges:
    report
  • juslikdat1
    Sorry, I was just trying out different possibilities in the code and pasted the code with the comment intact. I moved '*' to @PGMQ in the *inzsr. i.e before the write of the message subfile itself.MOVE      ’*’           @PGMQ
    440 pointsBadges:
    report
  • juslikdat1
    As you mentioned my MOVE will move the data to the right.. Ill try using EVAL and update you. Thanks.
    440 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following