File Handling Environment Variables

Lists environment variables related to configuring file handling.

COBDATA

Specifies the directory or directories that the run-time system is to search for data files.
Syntax
COBDATA=path-name[[:path-name][...]]
Parameter
path-name
The full path to a directory for the run-time system to search for application data files. When more than one path-name is present, a null path-name represents the current working directory.
Default
Not set. The run-time searches the current working directory.
Comments
This environment variable is 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.

COBDATA provides you with the facility to map data files globally, thus enabling you to put working data files in a directory whose name is not known until run time.

COBDATA affects the compiler and other utilities. During compilation, for example, program source is regarded as a data file by the compiler. If you intend to use any COBOL development system utilities, we recommend that the COBDATA value starts with a colon (:).

COBDATA is considered set if there is an environment variable of this name in your environment space, and its value is non-empty.

The full mapping order for files is:

  1. Any dd_ environment mappings
  2. Any ASSIGN TO EXTERNAL mappings
  3. Any COBDATA environment variable mappings

For multiple directory paths specified either in the COBDATA environment variable or a dd_ environment variable, the system searches the first directory specified followed by a slash (/) as a prefix to the user name.

If the filename is not found, or is not readable, the search continues with the next directory until the final directory has been searched. If no file is found, the first directory is used if a file is to be created.

Any dd_ and COBDATA mappings are ignored for any filename that starts with a hyphen () or a slash (/). In addition, it is illegal to have a hyphen in an environment variable name.

When using this facility, you should not use a filename that starts with "COB... "(these are reserved for the COBOL system).

You can use the COBDATA environment variable for files open in any mode (including OUTPUT) and for fixed or variable length files. If you are using indexed files, both the data and index files must be in the same directory.

The COBDATA environment variable affects file deletes, using the rules given here, as well as file opens.

If you intend to use COBOL development system programs, we recommend that you first unset COBDATA, as many of these programs open data files and are thus affected by the value of COBDATA. If you have to set COBDATA, you should include the paths :$COBDIR/dynload/helptbox.lbr and :$COBDIR/dynload/check.lbr at the beginning of the COBDATA value. If you want to see the Animator Help pages, also include COBDIR/dynload/advanim.lbr.

Example

The following causes COBDATA to be set to instruct the run-time system to search for data files in the current directory, then in the directory ./demo, then in the directory /home/data and finally in ./progs.

COBDATA=:demo:/home/data:progs

DB2DBDFT

The default database against which the DB2 SQL preprocessor processes SQL statements.
Syntax
DB2DBDFT=path-name/database-name
Parameters
path-name
The location of the default database.
database-name
The name of the default database.
Default
Not set. Uses the database name specified in the project.

ES_DB_FH

Enables or disables database file handler support. This is required if your data files are stored in a datastore, or your enterprise server region stores some of its resources in a database; see Micro Focus Database File Handler and Enterprise Server Region Database Management for more information.
Syntax
ES_DB_FH={[Y|true]|[N|false]}
Parameters
Y|true
Use the Micro Focus Database File Handler (MFDBFH) to direct file handling.
N|false
Disable database file handling.
Default
ES_DB_FH=N
Comments
Micro Focus recommends that you use the Advanced Region Properties page in the Enterprise Server Common Web Administration (ESCWA) interface to configure this environment variable. See Advanced Region Properties for more information.

ES_DB_SERVER

Specify the name of the database server to be used for region database operations.
Important: The configuration file specified by the MFDBFH_CONFIG environment variable must contain a corresponding <server> entry for the database server. <dsn> entries for the region, cross-region, and master databases must also be specified in the configuration file to enable use of region database operations.
Syntax
ES_DB_SERVER=server-instance
Parameter
server-instance
The name of a valid database server instance.
Default
Not set.
Comments
Micro Focus recommends that you use the Advanced Region Properties page in the Enterprise Server Common Web Administration (ESCWA) interface to configure this environment variable. See Advanced Region Properties for more information.
Example
ES_DB_SERVER=MYSERVER

In this example, your database configuration file would need to contain something similar to the following:

<datastores usevault="false">
   <server name="MYSERVER" type="sqlserver" access="odbc"> 
       <dsn name="SS.MYMASTER" type="database" dbname="master"/> 
       <dsn name="SS.CAS.ESDEMO" type="region.cas" region="ESDEMO" 
          feature="all"/> 
       <dsn name="SS.CAS.CROSSREGION" type="crossregion.cas"/>
   </server> 
</datastores>

ES_LOCKDB

Specifies the region database that is to process resource locking (step- and system-scoped ENQs) for an enterprise server region within a cluster, where resources such as catalogs are deployed to a database.
Syntax
ES_LOCKDB=region-db
Parameter
region-db
The name of the region database responsible for processing step- and system-scoped ENQs.
Default
Not set.
Comments
This variable must be used in conjunction with ES_SERVER, in which ES_SERVER is set to the database server that houses the region database; see Resource Locking for more information.

ES_RLS_FILE_SUPPORT

If a record is locked because a program is doing a read for update, and the application needs to ensure that no other program can access that record, you can set this environment variable to avoid returning a dirty record until the program holding the lock has completed.
Syntax
ES_RLS_FILE_SUPPORT=Y
Parameter
Y
Stops dirty records being returned when a record is locked by another process.
Default
Not set. Dirty records are returned.
Comments
The timeout in fileshare also needs to be set to 0 using /t 0 in the fileshare configuration file. See Using a Fileshare Configuration File for details.

Parameter values are not case sensitive.

EXTFH

Specifies a configuration file for the Callable File Handler.
Syntax
EXTFH=file-name.cfg
Parameter
file-name
The prefix name of the configuration (.cfg) file.
Default
Not set. The default configuration file name prefix is extfh.
Example
EXTFH=/home/mydir/myconfig.cfg

FHREDIR

Specifies a configuration file to be used by the Fileshare Client.
Syntax
FHREDIR=[path-name/]prefix.cfg}
Parameters
path-name
The full path to the location of the Fileshare Client configuration file.
prefix
The prefix name of the configuration (.cfg) file.
Default
Not set. Uses the fhredir.cfg file in the current working directory.
Example
FHREDIR=/home/mydir/myconfig.cfg

FS

Specifies a configuration file to be used by the Fileshare Server.
Syntax
FS=file-name.cfg
Parameter
file-name
The prefix name of the configuration (.cfg) file.
Default
FS=fs.cfg
Example
FS=myfsconf.cfg

FSCOMMS

Specifies that the Fileshare system is to run in single user mode.
Syntax
FSCOMMS="\$local"
Parameter
$local
Run the Fileshare System in single user mode.
Default
Not set. Fileshare system runs in multi-user mode.

LIB

The location of the DB2 LIB directory.
Syntax
LIB=path-name
Parameter
path-name
The path to your Windows SDK LIB directory (x86) containing .lib files such as odbc32.lib.
Comments
This environment variable is 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.

MFDBFH_CONFIG

Specifies the location and the name of the configuration file that defines the database server instances and associated databases.
Syntax
MFDBFH_CONFIG=path-name/file-name
Parameters
path-name
The full path to the location of the configuration file.
file-name
The file name of the configuration file.
Default
Not set. Uses the mfdbfh.cfg file found in the current working directory.
Comments
You can also set MFDBFH_CONFIG as a system environment variable.

MFDBFH_RECORD_LOCKING

Specifies the type of record locking that it is to be used when the database file handler is in effect.

Syntax
MFDBFH_RECORD_LOCKING={table|database}
Parameters
table
A file's record locks are held in a seperate lock table. (When using this locking mode, the behavior of record locking COBOL file operations closely follows the same behavior when using Fileshare.)
database
The native record locking mechanism of the database engine is used to establish and test locks on the data file records. This method improves performance, but at the cost of the locking behavior not exactly matching that of traditional COBOL record locking; see Record Locking Strategies for more information.
Default
MFDBFH_RECORD_LOCKING=table

MFDBFH_SCRIPT_DIR

Specifies the location of the scripts and stored procedures required when the database file handler is in effect.
Syntax
MFDBFH_SCRIPT_DIR=path-name
Parameter
path-name
The full path to the directory containing the required resources.
Default
MFDBFH_SCRIPT_DIR=$COBDIR/etc/mfdbfh/scripts

MFDBFH_VAULT

Specifies the name of a secrets vault.
Syntax
MFDBFH_VAULT=vault-name
Parameter
vault-name
The name of a vault that is defined in the product's secrets.cfg file.
Default
Not set. Uses the default vault as defined in secrets.cfg.
Comments
For more information on secrets vaults, see Vault Facility.

MFLOCKING

Enables Locking Support.

TXFILEP

The location of Micro Focus VSAM files.
Syntax
TXFILEP={path-name|datastore-location}
Parameters
path-name
The full path to the VSAM files on disk.
datastore-location
For database-hosted files, the location of the datastore containing the VSAM files. Use the notation described in the The dbfhdeploy Command Line Utility topic under Category > data.