Previous Topic Next topic Print topic


User Directives File

Use this file when you have a set of directives that you always want to use together.

The user directives file is an ASCII text file, which defines a set of directives to pass to the Compiler altogether at the same time. You use either the DIRECTIVES or USE Compiler directives to pass this file to the Compiler.

For example, to migrate some programs from a different dialect, put the directives you need to get compatibility with this dialect into a directives file, which you could call myDialectDirectives.dir. To use this file when compiling, use the USE or DIRECTIVES directive either in the project's properties in the IDE or in a $SET statement in your program. For example

USE"myDialectDirectives.dir"	

The directives file is searched for in the current and COBOL system directories. If no extension is specified, a file extension of .dir is added before the search is made. If no file is found, the search is repeated with no extension.

You can also use an environment variable as a parameter in either USE or DIRECTIVES:
DIRECTIVES"$mydirs"
When the environment variable mydirs is set to the path of your user directives file, it is resolved at compile time when you compile from the command line.

The Compiler processes the directives in the file as if they replace the USE or DIRECTIVES directive. Consequently, the restrictions applying to a directive at that time also apply to the directives read from the file at that time. Also any directives set later override the directives in your directives file

You can specify another directives file within the original directives file. The Compiler switches to the new directives file for processing and then returns to the original directives file. When the Compiler finishes processing the directives file, it then processes subsequent directives on the command line or in $SET statements.

Previous Topic Next topic Print topic