Code and Data File Search Paths

A series of directories can be specified that are used to locate program object files and data files. Object files are located via the CODE_PREFIX configuration variable. Data files are located by the FILE_PREFIX variable.

Each of these variables specifies a series of one or more directories to be searched for the desired code or data file. The search method is detailed in File Name Interpretation and Calling Subprograms.

The directories are specified as a sequence of space-delimited prefixes to be applied to the file name. All directories in the sequence must be valid names. The current directory can be indicated by a period (regardless of the host operating system). For example, the following line:

FILE_PREFIX    .  /usr/data

specifies that data files should first be searched for in the current directory and then in the /usr/data directory. For convenience, colons can be used along with spaces as a delimiter (except on Windows systems where semicolons are used, and VMS systems where commas are used). As an example of this, the following may be specified for a Windows system:

CODE_PREFIX    C:\;C:\OBJ

The "^" (carat) character can be specified in CODE_PREFIX to indicate the directory containing the calling program.

Note: Directory names with embedded spaces can be used as FILE_PREFIX and CODE_PREFIX configuration variables if the directory name is enclosed in quotes, for example:
FILE_PREFIX  C:\"Sales Data"

This example will cause the program to search for files first under the referenced directory name, and then in the current directory.

You can also specify a default file name extension for both code and data files. By default, ACUCOBOL-GT makes no assumptions about the file name extension used by files. A default name extension can be specified for code files by the configuration variable CODE_SUFFIX and for data files with the variable FILE_SUFFIX. These suffixes are automatically appended to any file name that does not explicitly contain an extension. A period is automatically placed between the file name and the extension, if needed.

For example, you can cause all of your object files to have the implicit extension of .COB by placing the following line in your configuration file:

CODE-SUFFIX  COB