expr is any expression that results in a scalar bit string value of length ≥ 1. The test-expression is considered true if any bit in the string is one; the expression is considered false only when all bits are zero. clause-n is any single preprocessor statement (other than %DECLARE, %PROCEDURE, %END or %DO), or a preprocessor DO group. Otherwise, the description is the same as that of Open PL/I IF statements.
Description
The %IF statement can control the flow of the scan according to the value of a preprocessor expression.
The preprocessor expression is evaluated. If the result of the evaluation is 1 or greater than 1, clause-1 is executed and clause-2 is ignored, if present. If the result of the evaluation is 0, clause-1 is ignored and clause-2, if present, is executed. In either case, the scan resumes immediately following the IF statement, unless, of course, a %GOTO in any of the clauses causes the scan to resume elsewhere. %IF statements can be nested according to the rules for nesting Open PL/I IF statements.