Rational Developer for System z
Enterprise PL/I for z/OS, Version 3.8, Language Reference Manual

%IF Statement

The %IF statement controls the flow of the scan according to the bit value of a preprocessor expression.

Read syntax diagramSkip visual syntax diagram>>-%--+------------+--IF--preprocessor-expression--%--THEN------>
      | .--------. |
      | V        | |
      '---label:-+-'
 
>--preprocessor-unit1--+-----------------------------+---------><
                       '-%--ELSE--preprocessor-unit2-'
 
preprocessor-expression
Is evaluated and converted to a bit string (if the conversion cannot be made, it is an error).
preprocessor-unit
Is any single preprocessor statement (other than %DECLARE, %PROCEDURE, %END, or %DO) a preprocessor DO-group, or a preprocessor SELECT-group. Otherwise, the description is the same as that given under IF statement.

If any bit in the string has the value '1'B, unit1 is executed and unit2, if present, is ignored; if all bits are '0'B, unit1 is ignored and unit2, if present, is executed.

Scanning resumes immediately following the %IF statement, unless, of course, a %GO TO or preprocessor RETURN statement in one of the units causes the scan to resume elsewhere.

%IF statements can be nested in the same manner used for nesting IF statements, as described under IF statement.


Terms of use | Feedback

This information center is powered by Eclipse technology. (http://www.eclipse.org)