Opening a data table
A data table must be opened before it can be used by an application. You open a data table in the same way as you would any CICS® file.
The following methods are supported:
- Automatically, by the CICS-supplied transaction CSFU, at the end of CICS startup, if the data table is defined with OPENTIME(STARTUP).
- Explicitly by a CEMT or EXEC CICS request issued by the user, or by CICS Explorer.
- Implicitly, on first reference to the data table, if the data table is defined with OPENTIME(FIRSTREF). The first remote access to a closed data table implicitly opens it.
All the rules and options for opening a CICS file also apply to a file that is defined as a data table. In addition, the loading of the data table is initiated unless it is a coupling facility data table with LOAD(NO).
For a large data table, loading could take a significant time. Developing for access to data tables discusses the application programming commands that can be used with a user-maintained shared data table or coupling facility data table, and the way that performance gains that can be achieved with a CICS-maintained shared data table are limited until loading is completed.
The following steps are done during the opening of the file:
- The access method control block (ACB) for the VSAM source data set is opened under a separate z/OS® task control block (TCB). This step is the same as for any CICS file.
- For the first shared data table used by a region, CICS:
- creates z/OS storage pools for use by shared data table support
- creates a z/OS data space for use by this region's data tables
- attempts a LOGON operation as a server
- A special CICS transaction, CFTL, is attached to load the data table into the data space, or CFCL to load a coupling facility data table if LOAD(YES) is specified.
- The transaction that issued the request to open the data table can now continue processing.
- For shared data tables, CICS issues a message DFHFC0940 to indicate that loading has started. The message is sent to the CSFL transient data queue.
- The transaction that loads the data table reads the source data set sequentially. Under the optional control of the user exit XDTRD, the transaction copies the records into a data table.
- For shared data tables, CICS issues a message to indicate
the result of the loading. The message number is:
- if loading is successful: DFHFC0941
- if loading fails: DFHFC0942, DFHFC0943, DFHFC0945, DFHFC0946, DFHFC0947, or DFHFC0948
- When loading is complete (whether successful or not), the user exit XDTLC is invoked if it is active. If the loading was not completed successfully, the exit program can request that the data table is closed.
- For a user-maintained shared data table or a coupling facility data table, the ACB for the source data set is closed when loading is complete. The data set is deallocated if it was originally dynamically allocated and becomes available to other jobs, providing there are no other ACBs still open for it.
Note: During an emergency restart, any file that requires backout
action is reopened. However, if the file is defined as a data table,
loading is not initiated at that time; instead it is initiated by
the CSFU transaction at the end of the emergency restart. This gives
an opportunity for any user exits that control the copying of records
to the data table during loading to be activated at any stage of PLTPI
processing.