Storing records temporarily is possible in CICS using TSQs. These are identified by a unique symbolic name, similar to files. The following logic can be used to write TSQs in a CICS program.

TSQs in CICS

  • Temporary storage queues do not have to be predefined to CICS. So these are called Temporary storage queues. Like scratch pad memory. You can read top 27 CICS interview questions here.
  • Temporary storage queues are not directly attached to a task. This means that temporary storage queues are task independent.
  • Once a temporary queue is written, it remains intact after the the task that created it has been terminated.
  • The WRITEQ TS command allows you to write records to a temporary storage queue. IF the queue exists with this command is issued, one will be created and the records will be written to it.
  • The READQ TS command allows you to read records, either sequentially or randomly from a temporarily storage queue.
  • Records in a TSQ can be updated and even re-written even by using the REWRITE option of the WRITEQ TS command
  • The DELETEQ TS command allows you to delete an entire TSQ. Individual records cannot be deleted
  • The queue name specified in TSQ must not exceed eight characters in length

Also read: How to modify VSAM file properties in CICS

Logic to Write TSQs

WRITEQ TS QUEUE (queue name)
FROM (data area)
LENGTH (data value)
ITEM (data area)
MAIN/AUXILARY
SYSID (name)

READQ TS QUEUE (queue name)
INTO  (data area)
LENGTH (data value)
ITEM (data area)
NUMITEMS (data area)
SYSID (name)

WRITE TS QUEUE (queue name)
FROM  (data area)
LENGTH (data value)
ITEM (data area)
MAIN/AUXILARY
SYSID (name)

DELETEQ TS QUEUE (queue name)
SYSID (name)

Related posts

One response

  1. […] In real time you are working on project. That project need to send few accumulated records you need to send for printing. The print application is external so in this kind of scenario you need TDQ. Since TSQs are local you cannot share data across regions. […]

    Like