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

ISO2002 conditional compilation uses the DEFINE Compiler option and/or the DEFINE directive to define compilation variables. These compilation variables can then be used in the IF and EVALUATE directives to include or omit selected lines of source code, enabling one to maintain a single source code that is capable of creating multiple variants of the same program.

ISO2002 conditional compilation directives are processed according to the following rules:

  • If a directive appears before a COPY or REPLACE statement, it is processed before the COPY or REPLACE statement is processed. This means that you can use ISO2002 conditional compilation to exclude COPY and REPLACE statements from a program.
  • The REPLACE statements or the REPLACING phrase of COPY statement has no effect on any of the conditional compilation directives.
  • Directives can appear in copybooks.