The IF directive provides a one- or two-way conditional compilation.
Note: In this section, the compiler directing statements DEFINE, EVALUATE, and IF are referenced using the ISO2002 terminology of
directives. When referring to the DEFINE Compiler option, it will be explicitly referenced as such.
- The keywords >>IF, >>ELSE, and >>END-IF must begin on a new line in either area A or area B, and must be specified entirely
on that line.
- The identifiers text-1 and text-2:
- Must begin on a new line, and may consist of multiple lines.
- May be any kind of source lines, including Compiler directives.
- Can include COPY statements.
- The phrases of a given IF directive must be specified all in the same library text or all in source text. For purposes of
this rule, text-1 and text-2 are not considered phrases of the IF directive. A nested IF directive specified in text-1 or
text-2 is considered a new IF directive.
- text-1 and text-2 are not part of the IF compiler directive line.
- The text in the branch that evaluates true is subject to matching and replacing rules of the COPY and REPLACE statements.
- If constant-conditional-expression-1 evaluates to TRUE, all the lines of text-1 are included in the resultant text. All lines
of text-2 are omitted.
- If constant-conditional-expression-1 evaluates to FALSE, all the lines of text-2 are included in the resultant text. All lines
of text-1 are omitted.