AS/400 subfile error message

55 pts.
AS/400 Subfiles
I have defined a field in the Subfile control record and defined the error message ERRMSG and conditioned it with indicator. Now when the indicator is on error messsage is not displayed on subfile. Below is the DDS code.
A            SVEND     R     Y  B  4 66REFFLD(VENDOR/VVEND PMS054/VENDPF)
A                                      EDTCDE(4)
A                                      CHECK(RB)
A  70                                  ERRMSG('invalid vendor number')

Answer Wiki

Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

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.
  • TheRealRaven
    What does the code look like that updates and redisplays the subfile? Without seeing all related code, it's hard to tell what might be wrong.
    35,630 pointsBadges:
  • NK2501
    The code is the DDS of the subfile. The field defined is the SVEND which is conditioned with indicator 70 ERRMSG ('invalid vendor number').
    Now in the RPGILE my code is First I display the header, footer and then Subfile.
    Write SFLHDR
    Write SFLCMD
    The subfile will be displayed where the operator is required to fille the items. The program is doing the check if the field SVEND is blank or zero it should display the message 'Invalid vendor number' on pressing the enter key.
    C                   IF        SVEND = 0                           
    C                   EVAL      *IN70 = *ON                         
    C                   MOVE      @TRUE         @ERR                  
    C                   ELSE                                          
    C     SVEND         CHAIN     VENDPF                             99
    if the value of SVEND = 0 the error message is not getting displayed.
    55 pointsBadges:
  • azohawk

    Hard to tell from the code you provided, but are you conditioning the display based on *IN99?

    4,055 pointsBadges:
  • philpl1jb
    What rows are sflcmd on?
    54,090 pointsBadges:
  • TheRealRaven
    I don't see anywhere in the provided code where the subfile row is rewritten/updated and the subfile is redisplayed. Simply setting an indicator on is not going to change anything on the screen. The screen has to be rewritten to transfer the indicator out of program memory out to the display. The indicator needs to be set against only the single subfile row that you want the message signaled against.
    35,630 pointsBadges:
  • NK2501
    Below is the DDS of the SFL.

    A          R ENTRYSFL                  SFL                               
    A*%%TS  SD  20160224  061818  PMS054      REL-V7R1M0  5770-WDS           
    A            SFRRN          2Y 0O  8  5EDTWRD('  .')                     
    A            SITEM     R     Y  B  8 12REFFLD(ITEM/IITEM PMS054/ITEMPF)  
    A                                      EDTCDE(4)                         
    A                                      DSPATR(PC)                        
    A                                      CHECK(RB)                         
    A            SQNTY     R     Y  B  8 25REFFLD(TRANS/DQNTY PMS054/TRANSPF)
    A                                      EDTCDE(4)                         
    A                                      CHECK(RB)                         

    Below is the DDS of SFLCTL

    A          R ENTRYCTL                  SFLCTL(ENTRYSFL)                    
    A*%%TS  SD  20160225  195301  PMS054      REL-V7R1M0  5770-WDS             
    A                                      CA03(03 'press F3 to exit.')        
    A                                      CA12(12 'press F12 to cancel.')     
    A                                      BLINK                               
    A                                      OVERLAY                             
    A                                      SFLCSRRRN(&CSRRRN)                  
    A  42                                  SFLDSP                              
    A  43                                  SFLDSPCTL                           
    A  40                                  SFLCLR                              
    A  42                                  SFLEND(*MORE)                       
    A                                      SFLSIZ(0012)                        
    A                                      SFLPAG(0010)                        
    A                                  4  3'Type the following, then press ent-
    A                                      er.'                                
    A                                      COLOR(BLU)                          
    A                                  4 56'Vendor..'                          
    A                                  6  5'Seq'                              
    A                                      DSPATR(HI)                         
    A                                  6 12'Item'                             
    A                                      DSPATR(HI)                         
    A                                  6 25'Quantity'                         
    A                                      DSPATR(HI)                         
    A            SVEND     R     Y  B  4 66REFFLD(VENDOR/VVEND PMS054/VENDPF) 
    A                                      EDTCDE(4)                          
    A                                      CHECK(RB)                          
    A  70                                  ERRMSG('Invalid Vendor Number')    
    A            SFLPS          4S 0H      SFLRCDNBR(CURSOR)              
    A            CSRRRN         5S 0H                                     

    Below is the RPG code.

    0073.00 C                   DOW       @EXIT = @FALSE       
    0074.00 C                   IF        CSRRRN > *ZEROS      
    0075.00 C                   EVAL      SFLPS = CSRRRN       
    0076.00 C                   ELSE                           
    0077.00 C                   EVAL      SFLPS = 1            
    0078.00 C                   ENDIF                          
    0079.00 C                   WRITE     SFLHDR               
    0080.00 C                   WRITE     SFLCMD               
    0082.00 C                   EXFMT     ENTRYCTL             
    0085.00  ** Process key response ***                       
    0086.00 C     KEY           CASEQ     @F03          @F03SR 
    0087.00 C     KEY           CASEQ     @F12          @F12SR 
    0089.00 C                   CAS                     @ENTKY 
    0090.00 C                   ENDCS                          
    0091.00 C                   ENDDO                          

    Below is the Enter subroutine.

    0184.00 C     @ENTKY        BEGSR                                           
    0185.00 C                   RESET                   @ERR                    
    0186.00 C                   IF        SVEND = 0                             
    0187.00 C                   EVAL      *IN70 = *ON                           
    0188.00 C                   MOVE      @TRUE         @ERR                    
    0189.00 C                   ELSE                                            
    0190.00 C     SVEND         CHAIN     VENDPF                             99 
    0191.00 C                   IF        *IN99 = *ON                           
    0192.00 C                   EVAL      *IN70 = *ON                           
    0193.00 C                   MOVE      @TRUE         @ERR                    
    0194.00 C                   ENDIF                                           
    0195.00 C                   ENDIF                                           
    0196.00 C                   IF        @ERR = @FALSE                         
    0197.00 C                   EXSR      @SFLRD                                
    0198.00 C                   ENDIF                                           
    0199.00 C                   ENDSR                                           

    Now if the SVEND = 0 the indicator 70 will be on but error message is not displayed.
    However the same thing I have achieved when I defined the message in the SFLMSG. But the requirement to use the ERRMSG. Please advise what is wrong.
    55 pointsBadges:
  • NK2501
    Above code is the application of the data entry subfile. Opeartor is required to enter the vendor number. If vendor number is 0 or blanks on not in data base then error message 'Invalid vendor number ' must be displayed.
    SFLHDR will have the heading and date time user filelds only.
    SFLCMD have only function keys F3 and F12
    Overlay has been specified.
    Code works well when I use the SFLMSG but not with ERRMSG
    55 pointsBadges:
  • NK2501

    Indicator 99 has been used with the CHAIN. Indicator 70 is with the ERRMSG
    55 pointsBadges:
  • ToddN2000
    Is the indicator being turned on before or after the control record is written?
    133,645 pointsBadges:
  • NK2501
    Indicator 70 is used only in the Enter subroutine. As this subroutine will be executed when the operator press the Enter key. This indicator gets on only when operator press Enter key and the filed SVEND = 0 and on other check if the value SVEND is > 0 the it checks the value in the data base file. If not found then indicator 70 will on. Else where in the whole program this indicator remains off.
    55 pointsBadges:
  • TheRealRaven
    What does this statement do?
    EXSR      @SFLRD
    From how it looks, it runs a subroutine that reads at least one subfile row, but the code looks to be so old that its hard to be sure. By the looks of it, the whole program needs to be rewritten. (I haven't seen a CASEQ statement in actual code in more than 20 years.)

    I still don't see anywhere in the code where the subfile row is rewritten or updated. Until the row is rewritten or updated, the indicator cannot make any difference to what's shown on the display.

    Simply setting the indicator in the program doesn't do anything but change a byte in memory. You have to send that byte to the row with an I/O operation (either a WRITE or UPDATE). Then redisplay the subfile.
    35,630 pointsBadges:
  • ToddN2000
    You have a field and a record both named SVEND?
    I do not see any code where the record SVEND is written.
    133,645 pointsBadges:
  • Splat
    NK2501, you have to update the subfile record after setting on *in70 (I'd recommend setting off *in70 after the update). 
    12,895 pointsBadges:

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.

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


Share this item with your network: