Specifying Conditional Compiler Constants

Compiler constant directives let you compile programs conditionally. Specify the conditional constants the parser uses to compile programs in the project in the Dialect Specific Options for your dialect in the Options - Project properties dialog box under the Verification tab. For Micro Focus COBOL, two formats are supported:
  • constant_name=value where no space is allowed around the equals sign. In the following example, if you specify WHERE=PC, the source that follows the $if clause is compiled:
    $if WHERE="PC"
               evaluate test-field
                   when 5 perform test-a
               end-evaluate
  • constant_name. In the following example, if you specify NOMF, the source that follows the $if clause is compiled:
    $if NOMF set
               $display Not MF dialect
                   go to test-a test-b depending on test-field
               $end