The THEN statement is an essential part of JCL conditional processing. It follows an IF statement and marks the beginning of a block of JCL statements that will be executed when the IF condition evaluates to true.
12345//[name] IF (condition) THEN // statements to be executed if condition is true [// ELSE // statements to be executed if condition is false] // ENDIF
1234// IF RC = 0 THEN //STEP2 EXEC PGM=GOODRUN //PRINT DD SYSOUT=A // ENDIF
12345// IF STEP1.RC < 8 THEN //STEP2 EXEC PGM=REGULAR // ELSE //STEP2 EXEC PGM=RECOVER // ENDIF
12345678// IF &SYSDAY = 'FRIDAY' THEN // IF &SYSTIME > '17:00' THEN // SET BACKUP='FULL' // ELSE // SET BACKUP='INCR' // ENDIF //STEP1 EXEC PGM=BACKUP,PARM='&BACKUP' // ENDIF