Example 3

The following example shows a simple IF/THEN/ELSE/ENDIF statement construct with a null ELSE clause.
//JOBB      JOB   ...
//STEP1     EXEC  PGM=RTN
             .
             .
//IFBAD     IF  (ABEND | STEP1.RC > 8) THEN
//TRUE      EXEC  PROC=ERROR
//          ELSE
//IFBADEND  ENDIF
//NEXTSTEP  EXEC  PROC=CONTINUE

The IF statement named IFBAD invokes procedure ERROR if either an abend has occurred on a previous step of the job, or STEP1 has returned a return code that is greater than 8. Otherwise, the system bypasses step TRUE, and the null ELSE clause passes to NEXTSTEP.