ContentsIndexPreviousNext

filename-HOST

The second variable which can be used to assign a newly-created file to a file system is filename-HOST. This configuration variable is used to assign an individual data file to a file system. Any file so assigned will use the designated file system, and not the one specified by DEFAULT-HOST.

Substitute the base name of the file for filename. The name you substitute should not include any directory names and should not include a file extension.

Example

For example, if the file CUSTFILE were the only file you wanted to assign to the Vision file system, and all other files were to be Informix files, you could specify:

DEFAULT-HOST  INFORMIX
CUSTFILE-HOST  VISION

in the configuration file.

See also

The DEFAULT-HOST variable, which specifies the file system to be used for all files not specified by filename-HOST.


Note: You can use DEFAULT-HOST and filename-HOST in combination to assign your new files in a default with exceptions manner; for example, this set of directives:
DEFAULT-HOST VISION
afile-HOST ORACLE
bfile-HOST ORACLE

means that all new files except afile and bfile will be assigned to Vision, and those two files will be assigned to Oracle.

You can change the values of these variables during program execution by including in your code:

SET ENVIRONMENT "filename-HOST" TO filesystem
                 or
SET ENVIRONMENT "DEFAULT-HOST" TO filesystem

This enables you to change file systems during the execution of your program. (This is not the typical way to specify a file system; it is usually designated in the runtime configuration file, and is not changed in the COBOL program.)