Environment variables (Windows)

These are the most common environment variables that can be used with the Micro Focus products on Windows.

The following environment variables are set in the system registry. You can change the values using the SET command, but values you set are only added to the values already set in the registry.

CCITCP2 Specifies the machine that the CCITCP2 daemon is running on.
COBCPY The location of COBOL copybooks.
COBDATA
Specifies one or more locations, separated by ; (Windows) or : (UNIX), in which to search for data files at run time. As long as the file assignment does not contain a sub-path (that is, a string containing \ or /) then the file assignment is appended to each location specified by COBDATA in order to locate the file.
Note: Users modernizing RM/COBOL or ACUCOBOL-GT legacy code can use a sub-path in the file assignment, but only by compiling with the relevant DIALECT or IDXFORMAT values for the respective File Handling systems; setting these values in the File Handling configuration file is not sufficient to achieve this.
COBDIR The location of the COBOL system directory.
COBHNF The location of .hnf files.
COBPATH Specifies the locations in which to search for .int, .gnt and .lbr files.

To specify more than one location, use the ; (semicolon) separator (Windows) or the : (colon) separator (UNIX).

LIB Tells the Linker where to find .lib files.
INCLUDE Specifies which directories should be searched for such things as resource include files.
PATH Indicates which directories Windows should search for executable files.

The following environment variables can be set from within your environment using the SET command:

COBCCSIDDIR For deployed application that use CCSID translation tables, this variable specifies the base directory in which all required translation tables are located.
COBCONFIG The location of COBOL configuration files.
COBCONFIG.BLOCK The location of the application configuration file.
COBFSTATCONV Specifies name of a user-supplied module that the Callable File Handler should use to convert the file status codes if an I/O error is encountered on a file.
COBIDY The location of debugger .idy files.
COBLANG Tells the COBOL system in which language environment you want to run your COBOL program. COBLANG can be used in conjunction with third party products using values of the LANG environment variable which are in a different format than that used by the COBOL system.
COBPRFDIR Specifies a directory to be used for storing .ipf files created by programs compiled with the PROFILE compiler directive.
COBSW Used to pass COBOL run-time system and user switch settings to user application programs.
DB2DBDFT Identifies the DB2 database to be accessed by the application.
DD_ Used to identify environment variables that define file-name mappings.
ENTRYNAMEMAP Specifies entry name map files and folders containing them.
EXTFH Specifies the File Handler configuration file to use.
FHREDIR Specifies a configuration file to be used by the Fileshare Client.
FSIDXINTEGRITY When this is set to OFF, this writing to disk any changed nodes held in the index cache, until space in the cache is needed for other nodes.
HCOBND Sets a directory for storing BIND files.
HELPFILES The list of files to be loaded at initialization by HyHelp.
LANG Tells the system in which language environment you want to run your program.
MAINFRAME_FLOATING_POINT Specifies the floating point format used.
MFCODESET Specifies which translation tables to use; see Codeset Translation for more details.
MFCODESET_DBCSDIR Specifies the location of the codeset mapping files required for certain DBCS conversions, where deployed applications do not have a full deployment product available; see Codeset Translation for more details.
MFCSCFG Specifies a configuration file to be used by the Client/Server Binding client program. It is also used by the Client/Server Binding server program when the srvtier facility is used.
MFJSERET Determines the response to an unsuccessful sort, copy or merge operation. Set to ABEND for an unsuccessful operation to abend and its program to continue instead of terminating with an unrecoverable error (return code 16).
MFJSTATS When this is set to ON, creates a report containing statistics for the SORT that is displayed to SYSOUT. If a report file already exists for a previous SORT, the new statistics are appended to the end of the previous one.
MFEXTMAP Used by the External File Mapper to locate the file mfextmap.dat.
MF_LE_CBLOPTS Specifies whether or not classic COBOL style options are in effect: options are Y or N. If not in effect or the dialect is ENTCOBOL, or it is a language other than COBOL, PARM syntax is of the form [run-time options] [/program-options]; otherwise, the syntax is of the form [program-options] [/run-time-options].
MFLOGDIR Specifies a directory to be used by the Client/Server Binding for log files.
MFRU_NOINHERIT Determines if processes are registered in shared memory during initialisation of the run-time system. COBRT105 errors can occur during initialisation if a very large number of COBOL processes are running and there are no available slots in the shared memory segment - setting this variable to Y or TRUE skips the registration process. However, when set to Y, various run-time settings (switches, shared memory, console window settings, etc...) are no longer inherited by any child processes. The default is that the variable is not set, which means that registration is not skipped.
OOSW Used to set run-time switches that effect OO programs.
SORTCOMPRESS Tells the system whether or not to execute a compression routine on each record to be sorted. Set SORTCOMPRESS to a positive integer to allow for run-length encoding of sort records, resulting in much better performance when records contain multiple repeated characters.
SORTSCHEME Use in conjunction with SORTSPACE for improved performance. This is activated by setting SORTSCHEME=1. This is the only valid value for the environment variable. See SORTSPACE below for more information.
SORTSPACE The amount of memory to be allocated to internal workspace for SORT operations. This can be specified in different formats: for example, you could specify 64M, 2G, and 1000000 to give sort memory areas of 64 Megabytes, 2 Gigabytes and 1000000 bytes respectively.
Typically, increasing SORTSPACE will improve the overall performance of your SORT. This can be further improved by the use of SORTSCHEME when the files to be sorted are over 1GB. Consider:
  • Setting SORTSCHEME when your files are in excess of 1GB.
  • The size of the record minus the key-size when setting SORTSCHEME on.
  • The SORTSPACE levels for SORTSCHEME. The following are the minimum settings for SORTSCHEME to take effect with the key size:
    • 1Mb or greater - records up to 5k non key
    • 4Mb or greater - records of 12K non key
    • 8Mb or greater - records of 28K non key
    • 16Mb or greater - records of 62k non key
    • For very large SORTs, a greater SORTSPACE maybe required.
  • Setting SORTSPACE to a higher value may result in more temporary file space being used.
SORTTEMPSPACE The amount of temporary memory to be allocated to internal workspace for SORT operations. This can be specified in different formats much like the SORTSPACE environment variable. By using SORTTEMPSPACE, you can maximize available memory.

To maximize the use of available memory to improve performance, particularly in systems suffering from memory fragmentation, the memory allocation strategy used by SORT can be adjusted through use of the SORTTEMPSPACE environment variable. Increasing the amount of SORTTEMPSPACE can help prevent "SORT020U SORT(EXTSM) failed - sort engine status = 9/105" error messages.

SORTTYPE Setting SORTTYPE=2 forces SORT to use the file handler, so that format modifications are picked up from the extfh.cfg file. Not setting this means SORT will try to use CBL_ routines to read and write files to improve performance. Note that 2 is the only valid value for this environment variable.
SQLPASS.TXT Supplies the user ID and password for automated compiles done on a remote DB2 server.
STRICTVSAM When set to ON and under a mainframe emulation, a file status of 37 is returned when you open an existing VSAM file for OUTPUT and the file has or previously had some data written to it, or if the file format is different from the file on disk. The default for this variable is OFF.
TESTCOVER Enables you to use the test coverage tool, which creates a statistical execution profile of a program. This should be set to the path of the test coverage configuration file.
TMP Tells the run-time system where to put paging files Normally it puts these files in the current directory. By using TMP you can specify a different drive or path for them.