Error handling in as/400 subfile options

510 pts.
Tags:
AS/400 Subfiles
RPG/400 Subfile
Subfile
In my Subfile,if i entered invalid Otions,i should get the reverse image on my field(Option),how is it possible...

if i use reverse image indicator for that field,i am getting for all the records as reverse image



Software/Hardware used:
as400

Answer Wiki

Thanks. We'll let you know when a new response is added.

You’ll have to set an indicator for reverse image on just the one field that you want to highlight (or fields). Then, when you are reading through the subfile looking for errors, turn that indicator on. Here’s the key you may be missing, though…everytime you read a subfile record that is not in error, you need to turn that indicator OFF. Otherwise it will continue to reverse image all the rest of your subfile records from that point on.

Discuss This Question: 12  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
  • 22917
    I used indicator for reverse image as 51-option then coding as follows, ReadC RMA02S1 40 Dow Not %Eof Select When OPT = '2' Eval *In51 = *Off ExSr Change When OPT = '4' Eval *In51 = *Off ExSr Delete When OPT = '6' Eval *In51 = *Off ExSr PRINT When OPT = ' ' Eval *In51 = *Off Other Eval erropt = 'Enter Valid Options' Eval *In51 = *On EndSL Update RMA02S1 ReadC RMA02S1 40 EndDo ******************************************************* Say how i have to change the code in above coding
    510 pointsBadges:
    report
  • 22917
    In above code,i m using sflnxtchg indicator 40 in readc... everything is fine except the if error occurs,it reverse imaging all the records(Options)
    510 pointsBadges:
    report
  • Teandy
    Use the following as an example:
    FADP0006FM CF   E             WORKSTN INFDS(WSINFDS)       
    F                                     INDDS(INDICATORS)    
    F                                     SFILE(ADP000601:RRN) 
    
     ********************************************************************** 
     *  INDICATOR DATA STRUCTURE BECAUSE OF THE INDARA COMMAND IN DSP FILE  
     ********************************************************************** 
    D INDICATORS      DS                                                    
    D  PLUS_CODE_ERROR...                                                   
    D                        25     25N   INZ(*OFF)                         
    
    
    READC ADP000601;                                        
                                                            
    DOW NOT %EOF(ADP0006FM);                                
                                                            
      IF SFLSEL <> '2' AND SFLSEL <> '4' AND SFLSEL <> ' '; 
                                                            
        IDX = 1;                                            
        PLUS_CODE_ERROR = *ON;                              
        EXSR DSPERROR;                                      
        SUBFILE_NXT_CHG = *ON;                              
        SFPAGE = RRN;                                       
        UPDATE ADP000601;                                   
                                                            
        LEAVE;                                              
    
    5,860 pointsBadges:
    report
  • Splat
    Try this instead:
    ReadC RMA02S1 40
    Dow Not %Eof
    Eval *In51 = *Off
    
    Select
    When OPT = ‘2′
    ExSr Change
    
    When OPT = ‘4′
    ExSr Delete
    
    When OPT = ‘6′
    
    ExSr PRINT
    
    When OPT = ‘ ‘
    
    Other
    Eval erropt = ‘Enter Valid Options’
    Eval *In51 = *On
    EndSL
    
    Update RMA02S1
    ReadC RMA02S1 40
    
    EndDo 
    6,885 pointsBadges:
    report
  • TomLiotta
    What does your subfile DDS look like? Tom
    125,585 pointsBadges:
    report
  • PGMBOB
    Caution using 40 on READC AND SFLNXTCHG.
    990 pointsBadges:
    report
  • Koohiisan
    @PGMBOB Caution using 40 on READC AND SFLNXTCHG. Could you elaborate?
    5,020 pointsBadges:
    report
  • TomLiotta
    I used indicator for reverse image as 51-option Please show us how it was used. The DDS is needed. The OPT field is apparently an 'I'nput field. Are you also using CHGINPDFT? Are you using ERRMSG() or ERRMSGID()? Are you conditioning DSPATR(RI)? Are you using a program-to-system field? Without seeing the DDS for the subfile, we can't know what the display file is doing. As for indicator 40 on the READC, it seems to serve no purpose. Tom
    125,585 pointsBadges:
    report
  • TomLiotta
    ...i m using sflnxtchg indicator 40 in readc... And this confuses indicator 40 even more. Tom
    125,585 pointsBadges:
    report
  • PGMBOB
    @PGMBOB Caution using 40 on READC AND SFLNXTCHG. Could you elaborate? Yes: The code shows *in40 as a result of the READC: ReadC RMA02S1 40 Dow Not %Eof *in40 is ALSO being used to condition SFLNXTCHG. I prefer using a different indicator for the results of READC
    990 pointsBadges:
    report
  • TomLiotta
    The code shows *in40 as a result of the READC: Unfortunately, it doesn't make clear if it's for ER or for EOF. But the %EOF() BIF is used in other statements; so we could think that it must be used as the error indicator, which, I suppose could somehow be used with SFLNXTCHG. If it's the EOF indicator, then it doesn't seem to serve any purpose and can be removed. Tom
    125,585 pointsBadges:
    report
  • 22917
    [...] Error handling in AS/400 subfile options [...]
    0 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