Admin Production rocket
Current Publication

Conditional Compilation

NetExpress Bookshelf Help V5.1 WrapPack 1
Rocket® Net Express™ (formerly a product of Micro Focus or formerly a product of Open Text) documentation, created before Rocket Software acquired certain products from OpenText, may include outdated references to "Micro Focus" or "OpenText", both of which are trademarks of OpenText or its affiliates. Rocket Software is not affiliated with Micro Focus or OpenText and has since rebranded these products as Rocket® products. You may also encounter outdated links in this documentation. If you do, please contact Rocket Support (support@rocketsoftware.com) for assistance.

MF Conditional Compilation

The COBOL system provides a mechanism for selectively compiling part or all of the COBOL source. To benefit fully from the advantages of conditional compilation the use of level 78 (see the topic Level Number) and the CONSTANT Compiler directive is recommended. Conditional compilation is controlled by $IF, $ELSE, $END constructs, which behave in a similar way to the COBOL IF construct. Conditional compilation also supplies the $DISPLAY statement, which can be used to display a message during compilation or include a version number in the object file.

Syntax Rules
  1. Conditional compilation statements are indicated by a dollar ($) in column 7 in fixed-format source, or column 1 in free-format source of the COBOL source line followed by one of the key words IF, DISPLAY, ELSE, END.
  2. Conditional compilation should not be used to split a COBOL character string; that is, continuation lines should not be split by conditional compilation controls.