Compiler and runtime environment variables

COBOL for AIX uses the following environment variables that are common to both the compiler and the run time.

COBPATH
Specifies paths to be used for locating user-defined compiler exit programs that the EXIT compiler option has identified. Specifies the directory paths to be used by the COBOL run time to locate dynamically accessed programs such as shared libraries.

This variable must be set to run programs that require dynamic loading. For example:

export COBPATH=/pgmpath/pgmshlib
DB2DBDFT
Specifies the database to use for programs that contain embedded SQL statements or that use the DB2 file system.
LANG
Specifies the locale (as described in the related task about using environment variables to specify a locale). LANG also influences the value of the NLSPATH environment variable as described below.

For example, the following command sets the language locale name to U.S. English:

export LANG=en_US
LC_ALL
Specifies the locale. A locale setting that uses LC_ALL overrides any setting that uses LANG or any other LC_xx environment variable (as described in the related task about using environment variables to specify a locale).
LC_COLLATE
Specifies the collation behavior for the locale. This setting is overridden if LC_ALL is specified.
LC_CTYPE
Specifies the code page for the locale. This setting is overridden if LC_ALL is specified.
LC_MESSAGES
Specifies the language for messages for the locale. This setting is overridden if LC_ALL is specified.
LC_TIME
Determines the locale for date and time formatting information. This setting is overridden if LC_ALL is specified.
LOCPATH
Specifies the search path for the locale information database. The path is a colon-separated list of directory names.

LOCPATH is used for any operations that reference the locale, including locale-based comparisons of alphanumeric data items.

NLSPATH
Specifies the full path name of message catalogs and help files. NLSPATH must always be set, and is given an initial value of usr/lib/nls/msg/%L/%N:/usr/lib/nls/msg/%L/%N.cat during installation. %L is substituted by the value specified by the LANG environment variable. %N is substituted by the message catalog name used by COBOL.

COBOL for AIX installation puts the messages in usr/lib/nls/msg/xx, where xx is any language that COBOL for AIX supports. The default is en_US.

When you set NLSPATH, be sure to add to NLSPATH rather than replace it. Other programs might use this environment variable. For example:

DIR=xxxx
nlspath=$DIR/%L/%N:$NLSPATH
export NLSPATH

xxxx is the directory where COBOL was installed. The directory xxxx must contain a directory xxxx/en_US (in the case of a U.S. English language setup) that contains the COBOL message catalog.

Messages in the following languages are included with the product:

en_US
English
ja_JP, Ja_JP
Japanese

You can specify the languages for the messages and for the locale setting differently. For example, you can set the environment variable LANG to en_US and set the environment variable LC_ALL to ja_JP.IBM-eucJP. In this example, any COBOL compiler or runtime messages will be in English, whereas native ASCII (DISPLAY or DISPLAY-1) data in the program is treated as encoded in code page IBM-eucJP (ASCII Japanese code page).

The compiler uses the combination of the NLSPATH and the LANG environment variable values to access the message catalog. If NLSPATH is validly set but LANG is not set to one of the locale values shown above, a warning message is generated and the compiler defaults to the en_US message catalog. If the NLSPATH value is invalid, a terminating error message is generated.

The runtime also library also uses NLSPATH to access the message catalog. If NLSPATH is not set correctly, runtime messages appear in an abbreviated form.

TMP
Specifies the location of temporary work files (if needed) for SORT and MERGE functions. The defaults vary and are set by the sort utility installation program.

For example:

export TMP=/tmp
TZ
Describes the time-zone information to be used by the locale. TZ has the following format:
export TZ=SSS[+|-]nDDD[,sm,sw,sd,st,em,ew,ed,et,shift]

If TZ is not present, the default is EST5EDT, the default locale value. If only the standard time zone is specified, the default value of n (difference in hours from GMT) is 0 instead of 5.

If you supply values for any of sm, sw, sd, st, em, ew, ed, et, or shift, you must supply values for all of them. If any of these values is not valid, the entire statement is considered invalid and the time-zone information is not changed.

For example, the following statement sets the standard time zone to CST, sets the daylight saving time to CDT, and sets a difference of six hours between CST and UTC. It does not set any values for the start and end of daylight saving time.

export TZ=CST6CDT

Other possible values are PST8PDT for Pacific United States and MST7MDT for Mountain United States.