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.
- On the command line, system default directives contained in cob options in the file
$COBDIR/etc/cobopt
(applies to UNIX environments only).
- On the command line, user default directives contained in cob options in the environment variable COBOPT
(applies to UNIX environments only).
- From within the IDE, directives set in the project or file properties, or on the command line, Compile-time directives specified in the cob command (applies to UNIX environments only).
- Directives set via the $SET statement within the source code.
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.
In addition to this order, 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.