Example 27: Verify utility conditional execution processing

      //JOB0027  JOB ...                                                                                              
      //CONDTEST EXEC PGM=IQIBUTIL                                                                                    
      //STEPLIB  DD DISP=SHR,DSN=IQI.SIQILOAD                                                                         
      //SYSPRINT DD SYSOUT=*                                                                                          
      //IN1      DD DISP=SHR,DSN=SYS1.MACLIB                                                                          
      //IN2      DD DISP=SHR,DSN=SYS1.LINKLIB                                                                         
      //IN3      DD DISP=SHR,DSN=SYS1.SAMPLIB                                                                         
      //FMLIST   DD SYSOUT=*                                                                                          
      //DIRLIST  DD SYSOUT=*                                                                                          
      //SYSIN    DD *                                                                                                 
        STEP1    FINDMEM  INDD=IN1,OUTDD=FMLIST                                                                            
                    SELECT   MEMBER=READ,WRITE                                                                                
                    IF RC=0,LIST=YES                                                                                          
        STEP2    FINDMEM INDD=IN2,OUTDD=FMLIST                                                                     
                    SELECT  MEMBER=XYZ                                                                                
                    IF RC=4                                                                                           
        STEP3    FINDMEM INDD=IN3,OUTDD=FMLIST                                                                  
                    SELECT  MEMBER=TEST*                                                                           
        STEP4       FINDMEM INDD=IN2,OUTDD=FMLIST                                                                  
                    SELECT  MEMBER=IEB*                                                                            
        STEP5       FINDMEM INDD=IN3,OUTDD=FMLIST                                                                     
                    SELECT MEMBER=ABC                                                                                 
        STEP6       LISTDIR INDD=IN3,OUTDD=DIRLIST,LIST=NO                                                               
                    SELECT MEMBER=X*                                                                                     

In this example we verify the following expected conditional execution:

  1. Completion return-code 0
  2. Completion return-code 4
  3. Completion return-code 0
  4. Conditionally skipped
  5. Conditionally skipped
  6. Completion return code 0

The expected job completion return-code 4.

Note: Due to "LIST=YES" of the first IF statement, all skipped statements will be listed.