Let's understand Mainframe
Home Tutorials Interview Q&A Quiz Mainframe Memes Contact us About us

Module 12: CICS Resource Definitions and Administration


TS Queue

TS queues (temporary storage queues) are CICS scratchpads. Tasks write data items, read them back by item number, and delete the queue when done. Unlike TD queues, TS queues never trigger transactions and are never defined one by one - they are controlled by TSMODEL definitions.

TS queues in a nutshell

  • Queue names are 1 to 16 characters, for example MYWORKQ. Any task can create one just by writing to it.
  • Items are numbered 1, 2, 3... as they are written. READQ TS reads by ITEM number.
  • MAIN queues live in memory - fast but gone at restart. AUXILIARY queues live on the TS data set and can survive restarts.
  • A queue stays until a task deletes it with DELETEQ TS or it expires.
  • Use the CEBR transaction to browse the contents of any TS queue online.

TSMODEL definitions

  • A TSMODEL definition sets defaults for every queue whose name starts with a PREFIX.
  • PREFIX - the leading characters matched, for example ORD* covers ORDQ1, ORDQ2.
  • LOCATION - MAIN or AUXILIARY default storage for matching queues.
  • RECOVERY - YES makes AUXILIARY queues recoverable across restarts.
  • SECURITY - controls whether queue names are security-checked.
  • EXPIRYINT - minutes after last use before CICS deletes the queue automatically.
  • Without a TSMODEL, queues take CICS defaults - usually MAIN storage, no recovery.

Using TS queues from COBOL

  • WRITEQ TS creates the queue and adds an item. The first write decides MAIN or AUX unless a TSMODEL says otherwise.
  • READQ TS with ITEM(n) reads one item. Use NUMITEMS to find how many items exist.
  • DELETEQ TS removes the whole queue and frees its storage.

Example - write, read back and delete a TS queue:

EXEC CICS WRITEQ TS QUEUE('ORDWORKQ') FROM(WS-ORDER-REC) LENGTH(200) MAIN END-EXEC. EXEC CICS READQ TS QUEUE('ORDWORKQ') INTO(WS-ORDER-REC) LENGTH(WS-REC-LEN) ITEM(1) END-EXEC. EXEC CICS DELETEQ TS QUEUE('ORDWORKQ') END-EXEC. * CEDA side - make every ORD* queue auxiliary and recoverable: CEDA DEFINE TSMODEL(ORDM) GROUP(ORDGRP) PREFIX(ORD) LOCATION(AUXILIARY) RECOVERY(YES) CEDA INSTALL GROUP(ORDGRP)





© copyright mainframebug.com
Privacy Policy
MainframeBug Assistant