Runtime environment variables

The COBOL runtime library uses the following runtime-only environment variables.

assignment-name
The user-defined word that you specify (in the ASSIGN clause) for the external file-name for a COBOL file; for example, OUTPUTFILE in the following ASSIGN clause:
SELECT CARPOOL ASSIGN TO OUTPUTFILE

At run time, you set the environment variable to the name of the system file that you want to associate with the COBOL file. For example:

export OUTPUTFILE=january.car_results

After you issue the command above, input/output statements for COBOL file CARPOOL operate on system file january.car_results in the current directory.

If you do not set the environment variable, or set it to the empty string, COBOL uses the literal name of the environment variable as the system file-name (OUTPUTFILE in the current directory for the ASSIGN example above).

The ASSIGN clause can specify a file stored in a file system other than the default, such as the standard language file system (STL) or the record sequential delimited file system (RSD). For example:

SELECT CARPOOL ASSIGN TO STL-OUTPUTFILE

In this case, you still set environment variable OUTPUTFILE (not STL-OUTPUTFILE).

CICS_TK_SFS_SERVER
Specifies the fully qualified Encina SFS server name. For example:
export CICS_TK_SFS_SERVER=/.:/cics/sfs/sfsServer
CLASSPATH
Specifies directory paths of Java™ .class files required for an OO application.
COBJVMINITOPTIONS
Specifies Java virtual machine (JVM) options used when COBOL initializes a JVM.
COBMSGS
Specifies the name of a file to which runtime error messages will be written.

To capture runtime error messages in a file, use the export command to set COBMSGS to a file-name. If your program has a runtime error that terminates the application, the file that COBMSGS is set to will contain an error message that indicates the reason for termination.

If COBMSGS is not set, error messages are written to the terminal.

COBOL_BCD_NOVALIDATE
Specifies if the packed-decimal data item is validated prior to conversion and arithmetic operations.

When this environment variable is set to 1, the digit and sign validation done prior to conversion and arithmetic operations is skipped.

Using this environment variable does not affect the numeric class test that tests whether a data item IS NUMERIC or IS NOT NUMERIC.

COBRTOPT
Specifies the COBOL runtime options.

Separate runtime options by a comma or a colon. Use parentheses or equal signs (=) as the delimiter for suboptions. Options are not case sensitive. For example, the following two commands are equivalent:

export COBRTOPT="CHECK(ON):UPSI(00000000)"
export COBRTOPT=check=on,upsi=00000000

If you specify more than one setting for a given runtime option, the rightmost such setting prevails.

The defaults for individual runtime options apply. For details, see the related reference about runtime options.

EBCDIC_CODEPAGE
Specifies an EBCDIC code page applicable to the EBCDIC data processed by programs compiled with the CHAR(EBCDIC) or CHAR(S390) compiler option.

To set the EBCDIC code page, issue the following command, where codepage is the name of the code page to be used:

export EBCDIC_CODEPAGE=codepage

If EBCDIC_CODEPAGE is not set, the default EBCDIC code page is selected based on the current locale, as described in the related reference about the locales and code pages supported. When the CHAR(EBCDIC) compiler option is in effect and multiple EBCDIC code pages are applicable to the locale in effect, you must set the EBCDIC_CODEPAGE environment variable unless the default EBCDIC code page for the locale is acceptable.

ENCINA_CDS_ROOT
Specifies the Encina SFS server base name. For example:
export ENCINA_CDS_ROOT=/.:/cics/sfs
ENCINA_SFS_DATA_VOLUME
Specifies the name of the SFS data volume on which SFS files are to be created. For example:
export ENCINA_SFS_DATA_VOLUME=sfs_SFS_SERV

This data volume must have been defined to the SFS server that your application accesses.

If this variable is not set, the default name encinaSfsVol is used.

ENCINA_SFS_INDEX_VOLUME
Specifies the name of the SFS data volume on which alternate index files are to be created. For example:
export ENCINA_SFS_INDEX_VOLUME=sfs_SFS_SERV

This data volume must have been defined to the SFS server that your application accesses.

If this variable is not set, alternate index files are created on the same data volume as the corresponding base index files.

ENCINA_VSAM_AUTO_FLUSH
Specifies whether all changes to Encina SFS files for each input-output operation are committed to disk before control is returned to the application (that is, whether the operational force feature of SFS is enabled). You can improve the performance of applications that use SFS files by specifying OFF for this environment variable. For example:
export ENCINA_VSAM_AUTO_FLUSH=OFF

When this environment variable is set to OFF, SFS uses a lazy-write strategy; that is, changes to SFS files might not be committed to disk until the files are closed.

If SFS client-side caching is in effect (that is, environment variable ENCINA_VSAM_CACHE is set to a valid nonzero value), the setting of ENCINA_VSAM_AUTO_FLUSH is ignored. Operational force is disabled.

If SFS client-side caching is not in effect, the value of ENCINA_VSAM_AUTO_FLUSH defaults to ON.

ENCINA_VSAM_CACHE
Specifies whether client-side caching is enabled for SFS files. You can improve the performance of applications that use SFS files by enabling client-side caching.
Read syntax diagramSkip visual syntax diagram
ENCINA_VSAM_CACHE syntax

>>-+-read-and-insert-cache-size---------------------------------+-><
   '-read-cache-size:insert-cache-size--+---------------------+-'   
                                        |       .-----------. |     
                                        |       V           | |     
                                        '-:flag---+-------+-+-'     
                                                  '-,flag-'         

Size units are in numbers of pages. A size of zero indicates that caching is disabled. The possible flags are:

ALLOW_DIRTY_READS
Removes the restriction for read caching that the files being accessed must be locked.
INSERTS_DESPITE_UNIQUE_INDICES
Removes the restriction for insert caching that inserts are cached only if all active indices for clustered files and all active alternate indices for entry-sequenced and relative files allow duplicates.

For example, the following command sets the read-cache size to 16 pages and the insert-cache size to 64 pages. It also enables dirty reads and enables inserts despite unique indices:

export ENCINA_VSAM_CACHE=16:64:ALLOW_DIRTY_READS, \
    INSERTS_DESPITE_UNIQUE_INDICES

By default, client-side caching is not enabled.

LIBPATH
Specifies the full path name for the COBOL runtime library. The default is set at installation.
PATH
Specifies the directory paths of executable programs.
SYSIN, SYSIPT, SYSOUT, SYSLIST, SYSLST, CONSOLE, SYSPUNCH, SYSPCH
These COBOL environment names are used as the environment variable names that correspond to the mnemonic names used in ACCEPT and DISPLAY statements.

If the environment variable is not set, by default SYSIN and SYSIPT are directed to the logical input device (keyboard). SYSOUT, SYSLIST, SYSLST, and CONSOLE are directed to the system logical output device (screen). SYSPUNCH and SYSPCH are not assigned a default value and are not valid unless you explicitly define them.

For example, the following command defines CONSOLE:

export CONSOLE=/users/mypath/myfile

CONSOLE could then be used in conjunction with the following source code:

SPECIAL-NAMES.
    CONSOLE IS terminal
    . . .
    DISPLAY 'Hello World' UPON terminal

related references  
CHAR  
Runtime options