Controling File ENABLE and OPEN Requests
CONNX for VSAM provides two environment variables which can be used to control file ENABLE and OPEN requests. For example, CICS VSAM files are usually defined to RDO ( Resource Definition Online) with initial statuses:
STATUS(UNENABLED) OPENTIME(FIRSTREF)
or to the FCT (File Control Table) via the macro syntax:
FILSTAT=(ENABLED,CLOSED)
When the CONNX VSAM server program receives an SQL request from an ODBC/OLE DB/.NET/JDBC application, it first checks the status of the target VSAM file. If the VSAM file is CLOSED and not currently ENABLED, the CONNX VSAM server program sets the VSAM file status to ENABLED and OPEN, and then performs the SQL request. This default behavior can be overridden by two CONNX environment variables: SETENABLED and SETOPEN.
The CONNX SETENABLED and SETOPEN environment variables can be added, changed, and deleted via the NX01 CICS Transaction. The valid values for both SETENABLED and SETOPEN are 0 = off and 1 = on. The default value for both SETENABLED and SETOPEN is 1.
The possible combinations and actions for SETENABLED and SETOPEN are:

SETENABLED | SETOPEN | Action
0 | 0 | If the file is not ENABLED, or if the file is ENABLED but not OPEN, reject the query.
0 | 1 | If the file is not ENABLED, reject the query. If the file is ENABLED but not OPEN, open the file and execute the query.
1 | 0 | If the file is not ENABLED, ENABLE the file. If the file is not OPEN, reject the query.
1 | 1 | Default Settings. If the file is not ENABLED, ENABLE the file. If the file is not OPEN, open the file and execute the query.

In all of these cases, if the target VSAM file is ENABLED and OPEN, execute the query.
1. To set the CONNX SETENABLED and SETOPEN environment variables, logon to the CICS region / partition on which CONNX is installed, clear the screen, and enter:
nx01 SETENABLED 1
The Entry Added message appears.
2. To set the CONNX SETOPEN environment variable, logon to the CICS region/partition on which CONNX is installed, clear the screen, and enter:
nx01 SETOPEN 1
The Entry Added message appears.
3. To display the current CONNX environment variables, clear the screen and enter NX01.