Compiler directives can be specified using more than one method. During compilation, they are processed in a particular order
according to the method in which they have been specified.
The Compiler processes directives specified on the command line from left to right. If a directive appears more than once,
the Compiler uses the setting that it processed last for that directive.
The Compiler processes directives in the following order:
- Directives contained within the system-wide directives file
cobol.dir.
Note: If NOCOBOLDIR is set anywhere, the directives in this file are not processed.
- Directives contained within the common directives file,
directives.mf.
- On the command line, system default directives contained in cob options in the file
$COBDIR/etc/cobopt
.
- On the command line, user default directives contained in cob options in the environment variable COBOPT
.
- The IDE applies the DIALECT directive specified in the project properties.
Note: This can result in other directives being applied. See
DIALECT in the Compiler Directives chapter for more information.
- From within the IDE, directives set in the project, build configuration, folder, and then file properties, or on the command line, Compile-time directives specified in the cob command.
- Directives set via the $SET statement within the source code (COBOL only).
In addition, you can set directives in a user directives file, which you specify with the USE directive; these are processed
when they are encountered.
The above order means that, for example, a directive set using a $SET statement would override the setting for that directive
that has been set in the project properties.