There are two types of queues available in CICS.
Temporary Storage Queue (TSQ)
Transient Data Queue (TDQ)
No need to predefine anywhere. By default, TS queues are created in main memory. So the content cannot be recovered after system crash. If you want to recover, then you should define them in TST.
Records can be randomly accessed using ITEM option of READQ. READ is not destructive.
Deletion of queue deletes all the records in it. Deletion of recoverable TSQ should follow sync point before next WRITEQ.
Primarily used as scratch pad memory facility for any purpose.
Example: Page-up and Page-down logic, Passing huge data in between the phases of transaction, Review and correction of multiple order entry screens.
It is used to add items to an existing TSQ. Also, we can create a new TSQ using this command. Below is the syntax for WRITEQ TS command.
EXEC CICS WRITEQ TS QUEUE('queue-name') FROM(queue-record) [LENGTH(queue-record-length)] [ITEM(item-number)] [REWRITE] [MAIN/AUXILIARY] END-EXEC. |
The QUEUE is identified by the name which is mentioned in this parameter.
FROM and LENGTH options are used to specify the record that is to be written to the queue and its length.
If the ITEM option is specified, CICS assigns an item number to the record in the queue, and sets the data area supplied in that option to the item number. If the record starts a new queue, the item number assigned is 1 and subsequent item numbers follow on sequentially.
The REWRITE option is used to update a record already present in the queue.
MAIN / AUXILIARY option is used to store records in main or auxiliary storage. Default is AUXILIARY.
It is used read the Temporary Storage Queue. below is the syntax of READQ TS.
EXEC CICS READQ TS QUEUE('queue-name') INTO(queue-record) [LENGTH(queue-record-length)] [ITEM(item-number)] [NEXT] END-EXEC. |
It command is used delete the Temporary Storage Queue. Following is the syntax of DELETEQ TS.
EXEC CICS DELETEQ TS QUEUE('queue-name') END-EXEC. |
TDQ should be predefined in DCT.
READ is destructive and only sequential. Once the record is READ, it will be logically deleted and cannot be read again.
Automatic Task Initiation: When number of records in the queue exceeds the TRIGLEV defined in the DFHDCT entry of the queue, the transaction coded in the TRANSID of DFHDCT is automatically triggered. This ATI is possible only in TDQ.
There are two types of TDQ – Intra and Extra partition. The DCT entry identifies the type of queue from TYPE parameter.
Intra Partition Queues are used within a CICS region and DELETEQ deletes all the records physically in the queue.
Extra partition Queues are used across the regions and systems. If you want to pass some data from CICS to batch or receive data from Batch to CICS, you should go for extra partition queue.
It is used to write Transient data queues and they are always written to a file. below is the syntax of WRITEQ TD command.
EXEC CICS WRITEQ TD QUEUE('queue-name') FROM(queue-record) [LENGTH(queue-record-length)] END-EXEC. |
It is used read the Transient data queue. Below is the syntax of READQ TD.
EXEC CICS READQ TD QUEUE('queue-name') INTO(queue-record) [LENGTH(queue-record-length)] END-EXEC. |
It is used delete the Transient data queue. Following is the syntax of DELETEQ TD.
EXEC CICS DELETEQ TD QUEUE('queue-name') END-EXEC. |
If you have any doubts or queries related to this chapter, get them clarified from our Mainframe experts on ibmmainframer Community!