Your Browser is not longer supported

Please use Google Chrome, Mozilla Firefox or Microsoft Edge to view the page correctly
Loading...

{{viewport.spaceProperty.prod}}

IF directive

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

  1. 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.

  2. 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.

  3. source-text-1 and source-text-2 may contain a maximum of 1 COPY statement in any line.

General rules

  1. The IF directive is processed during the execution of COPY and REPLACE statements.

  2. If boolean-expression-1 is true, source-text-1 is compiled if it exists, and source-text-2 is ignored.

  3. If boolean-expression-1 is not true, source-text-1 is ignored, and source-text-2 is compiled if it exists.