Application programming for a CICS-maintained data table

CICS® handles a CICS-maintained data table and its source data set as a single entity. After the data table has been loaded, CICS automatically keeps the contents of the data table and the source data set consistent; any changes that an application makes to the file are reflected in both. In almost all situations, the use of a data table is transparent to the application programmer.

All file control commands and options can be used for a CICS-maintained data table. Some commands are performed by access only to the data table (using cross-memory services for shared files), some by access only to the source data set (using function shipping for shared files), and some by access to both.

The following commands usually access only the data table:
  • READ commands without the UPDATE or RBA options
  • STARTBR, RESETBR, READNEXT, and READPREV commands without the RBA option
  • ENDBR command (unless the browse sequence has accessed the source data set)
The following commands access only the source data set:
  • READ commands with the UPDATE or RBA options
  • STARTBR, RESETBR, READNEXT, and READPREV commands with the RBA option
  • ENDBR command for a browse sequence that has accessed the source data set
The following commands might access both the data table and the source data set:
  • READ and browse commands (that would usually access only the data table) that find a gap in the key sequence of records in the data table. This gap might indicate that one or more records are missing from the data table because:
    • records have been suppressed by a user exit
    • the maximum number of records has been reached
    • insufficient virtual storage is available for the data table
    • some abnormal event has occurred
  • READ, READNEXT, and READPREV commands for records that are currently being processed by a WRITE, REWRITE, or DELETE command. These commands need to first access the data table to determine that this situation exists.
  • WRITE, REWRITE, and DELETE commands. These commands are always executed in the FOR, where they first update the source data set. If this is successful, a corresponding change to the data table is attempted using local shared data table services in the FOR. In the case of a WRITE command, the addition of the record to the data table might be rejected by the XDTAD user exit or might fail because the data table is full, or insufficient virtual storage is available.

Generic reads for a CICS-maintained data table

For applications that carry out generic reads, using the GENERIC option on the READ command, there is a difference in behavior for a CICS-maintained data table compared to a VSAM file. You might need to modify these applications when you convert a VSAM file to a CICS-maintained data table.

For a generic read of a VSAM file, if CICS returns a NOTFND condition because the record is not found in the table, the INTO() and RIDFLD() areas from the READ command are left unchanged. However, for a generic read of a CICS-maintained data table, if CICS returns a NOTFND condition, CICS clears the INTO() and RIDFLD() areas to ensure that an incorrect record is not returned.

This behavior optimizes performance for CICS-maintained data tables, but it means that applications can no longer depend on the original values in the INTO() and RIDFLD() areas being returned. If you have any applications that carry out generic reads, modify them as necessary to take appropriate action if a NOTFND condition is returned and the INTO() and RIDFLD() areas are cleared.