Using temporary storage

In CICS®, temporary storage is the primary method for storing data that must be available to multiple transactions. Data items in temporary storage are placed in queues with names assigned dynamically by the program storing the data. Temporary storage is implemented in two different ways: main temporary storage and auxiliary temporary storage:
Main and auxiliary storage have the following characteristics:

Accessing temporary storage from EGL

An EGL program generated for the CICS environment can access CICS temporary storage as a serial or relative record. The following I/O statements are valid when you access temporary storage:

The resource association for the file must have the EGL file type specified as tempaux (auxiliary storage file) or tempmain (main storage file) when the program is generated. The system resource name (systemName property) is the queue name associated with the temporary storage file.

Temporary storage files can be used by only one task at a time. EGL generates the following CICS commands for you:

Non-EGL programs that access the same file should enqueue on the same system resource name while accessing the file.

Records in temporary storage have an additional byte added to the front of the record that indicates the status of the record:
X'01'
indicates that the record has been logically deleted.
X'00'
indicates that the record logically exists in the file.
The additional byte is added to the record definition and managed by Rational COBOL Runtime for z/Series. Do not include the additional byte in the EGL record definition. However, if the temporary storage file is also used by a non-EGL program, the non-EGL program must allocate space for the byte, interpret the byte, and update it as EGL does. Processing of the additional byte is as follows:
add or replace
The byte is set to X'00'.
delete
The byte is set to X'01' and the record length is set to 1.
get next
Records with a value of X'01' are skipped.
get or get forUpdate
Records with a value of X'01' cause a noRecordFound record state to be set.
The close statement does not delete temporary storage files. Use the sysLib.purge() system function to delete the file. EGL enqueues by generating a CICS ENQ command with the NOSUSPEND option on resource name EZETEMP-queuename when sysLib.purge() is used and dequeues (DEQ command) after the queue is deleted.

Feedback