z/OS MVS JCL Reference
Previous topic | Next topic | Contents | Contact z/OS | Library | PDF


Example 4

z/OS MVS JCL Reference
SA23-1385-00

The following example shows a simple IF/THEN/ELSE/ENDIF statement construct with an ELSE clause.
//JOBC      JOB    ...
//STEP0     EXEC   PGM=RTN1
             .
             .
//IFTEST2   IF  (RC > 4 & RC < 8) THEN
//*                 *** WARNING CONDITION REPORTING GROUP ***
//STEP1     EXEC   PGM=IEFBR14
//REPORT    EXEC   PROC=REPTRTN
//*                 *** WARNING CONDITION REPORTING GROUP END ***
//          ELSE
//ERRORSTP  EXEC   PROC=ERRORTN
//ENDTEST2  ENDIF
//NEXTSTEP  EXEC   PROC=CONTINUE
Processing for this IF/THEN/ELSE/ENDIF statement construct is:
  1. If the relational-expression for the IF/THEN statement construct named IFTEST2 is true (the highest step return code for the job is greater than 4 and less than 8 at the point when this statement is being processed), the system processes the THEN clause. The system executes program IEFBR14 and procedure REPTRTN on EXEC statements STEP1 and REPORT.
  2. Otherwise, the relational-expression for IFTEST2 is false and the system processes the ELSE clause (procedure ERRORTN on EXEC statement ERRORSTP).
  3. Processing then continues with procedure CONTINUE on step NEXTSTEP.

Go to the previous page Go to the next page




Copyright IBM Corporation 1990, 2014