ISO2002 Compiler Directives

A compiler directive specifies options or compilation variables for use by the compiler.

General Format:
>>compiler-instruction
Syntax Rules:
  1. A compiler directive must be specified on one line, except for the EVALUATE and the IF directives for which there are specific rules.
  2. A compiler directive must be preceded only by zero, one, or more space characters. When the reference format is fixed format, a compiler directive must be specified in the program-text area and may be followed only by space characters.
  3. When the reference format is free format, a compiler directive can be followed only by space characters and an optional in-line comment.
  4. A compiler directive is composed of the two contiguous COBOL characters >>, optionally followed by the COBOL character space, followed by compiler-instruction. >> is treated as though it were followed by a space if no space is specified after >>.
  5. Compiler-instruction is composed of the compiler-directive words defined in the specific syntax for each directive.
  6. A compiler-directive word is reserved within the context of the compiler directive in which it is specified and may be used elsewhere as any type of COBOL word.
  7. A compiler directive can be specified anywhere in a compilation group except
    • As restricted by the rules for the specific compiler directive,
    • Within a source text manipulation statement,
    • Between the lines of a continued character string,
    • On a debugging line.
  8. Compiler directive lines can be specified within library text.
  9. A literal in a compiler directive must not be specified as a concatenation expression or a figurative constant.
General Rules:
  1. A compiler directive is treated as a single blank line during the matching operation of a COPY or REPLACE statement. A directive will not match any pseudo-text or partial-word and therefore is not affected by the replacing action.
  2. A compiler directive is processed before, during, or after the processing of COPY and REPLACE statements as indicated in the specific rules for each directive.
  3. The compiler directives >>EVALUATE, and >>IF, when specified in the source-text of >>IF and >>EVALUATE directives take effect when encountered during conditional compilation. All other compiler directives are processed when the source code resulting from conditional compilation is processed.