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 the cases above, if the target VSAM file is ENABLED and OPEN, execute the query.
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:
The Entry Added message appears.
To se 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.
To display the current CONNX environment variables, clear the screen and enter NX01:
Examples:
The default case. The CONNX sample VSAM KSDS file CNXCSTK has not been accessed by a CONNX query. The initial file status
as displayed by the CEMT INQ FI(CNXCSTK) transaction is CLOSED (Clo) and UNENABLED (Une).
If the CONNX SETENABLED and SETOPEN environment variables have not been defined with the NX01 transaction, or if they are
defined and set to the default value = 1 as above, then the first CONNX query against the CNXCSTK file will cause the file
to be ENABLED and OPENED before the query results are returned to the requesting client. The file remains ENABLED and OPENED
for the lifetime of the CICS region/partition. The file status after successful query execution is:
Both SETENABLED and SETOPEN are defined and set to 0.
The CNXCSTK VSAM file is in its intial state of CLOSED (Clo) and UNENABLED (Une). When the CONNX VSAM server program receives
a query request for the CNXCSTK file, it checks the current status and finds that the file is not ENABLED and CLOSED. The
CONNX variable SETENABLED is defined as 0, so the CONNX VSAM server bypasses the file enable logic and returns the following
message to the client application:
SETENABLED is set to 1 and SETOPEN to 0.
The CNXCSTK VSAM file is in its intial state of CLOSED (Clo) and UNENABLED (Une). When the CONNX VSAM server program receives
a query request for the CNXCSTK file, it checks the current status and finds that the file is not ENABLED and CLOSED. The
CONNX VSAM server program enables the file and bypasses the open attempt, because SETOPEN is set to 0. The following message
is returned to the client application:
The CNXCSTK VSAM file status is now ENABLED and CLOSED: