The IF/THEN/ELSE/ENDIF statement construct tests whether these conditions occurred in the job, a step, or a procedure step prior to the IF/THEN/ELSE/ENDIF statement construct.
//[name] IF (relational expression) THEN
//STEPTRUE EXEC
//[name] ELSE
//STEPFALS EXEC
// ENDIF
Comparison operators compare a relational expression keyword to a numeric value. The comparison results in a true or false condition. Use the logical operators & (AND) and | (OR) in complex relational expressions, to indicate that the system evaluates the Boolean result of two or more relational expressions. The ¬ (NOT) operator reverses the testing of the relational expression. Relational expression keywords indicate that you are evaluating a return code, abend condition, or abend completion code.
Either the THEN clause or ELSE clause must contain at least one EXEC statement. The EXEC statement indicates a job step that the system executes based on its evaluation of the relational expression. A THEN or ELSE clause that does not contain an EXEC statement is a null clause.
You can nest IF/THEN/ELSE/ENDIF statement constructs up to 15 levels of nesting.