The IF directive supports the conditional compilation of one or two alternatives.
Format
>>IF boolean-expression-1
[source-text-1]
[>>ELSE
[source-text-2]]
>>END-IF
Syntax rules
The parts of the compiler directive introduced with >> must be specified together with the succeeding operands, each in a separate line.
source-text-1 and source-text-2 must begin on a new line.The source lines must be entered as specified in the format, and both source-text-1 and source-text-2 may span multiple lines. The source texts may also include compiler directives.
source-text-1 and source-text-2 may contain a maximum of 1 COPY statement in any line.
General rules
The IF directive is processed during the execution of COPY and REPLACE statements.
If boolean-expression-1 is true, source-text-1 is compiled if it exists, and source-text-2 is ignored.
If boolean-expression-1 is not true, source-text-1 is ignored, and source-text-2 is compiled if it exists.