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 on the Project Verification options 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 on the Project Verification options tab, 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 on the Project Verification options tab, 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