CICSintermediate
Temporary Storage and Transient Data Queues
Understand CICS's two queuing mechanisms — temporary storage (TS) queues and transient data (TD) queues — and when each is the right tool.
Two queuing mechanisms with similar names and genuinely different purposes. Confusing them is a common and telling mistake.
A TS queue is a shared corkboard where you can pin, re-read, and even swap out any numbered note at any time; a TD queue is a mail slot that automatically rings a bell (triggers a transaction) the moment enough letters pile up, and each letter is gone the moment someone actually reads it.
Key Concepts
1
Temporary Storage: a scratchpad, addressed by item number.
EXEC CICS WRITEQ TS QUEUE('RESULTS01') FROM(WS-ITEM)
LENGTH(200) ITEM(WS-ITEM-NO) END-EXEC.2
EXEC CICS READQ TS QUEUE('RESULTS01') INTO(WS-ITEM)
LENGTH(200) ITEM(5) END-EXEC.3
Items are numbered, readable in any order, and rewritable.
4
The classic use is paging through results. A search returns 200 rows and the screen shows 20.
5
task 1: run the search once, write 200 items to a TS queue,
display items 1-20
task 2: user presses PF8. Read items 21-40 from the queue.
The search is not run again.6
Without it, every page-down repeats the query — which is both slower and can return different rows if the
data changed underneath.
7
TS queues outlive the task that created them, which is what makes this possible across a
pseudo-conversational flow. They must be deleted when finished, or they accumulate.
8
Transient Data: a sequential pipe that can trigger work.
EXEC CICS WRITEQ TD QUEUE('LOGQ') FROM(WS-MSG) LENGTH(80) END-EXEC.
EXEC CICS READQ TD QUEUE('LOGQ') INTO(WS-MSG) LENGTH(WS-LEN) END-EXEC.9
Strictly sequential. Reading an item consumes it — there is no re-reading and no item numbers.
10
The distinguishing feature is the trigger level. A TD queue can be defined so that when a set number of
items have been written, CICS automatically starts a named transaction.
11
trigger level 100 -> after the 100th write, CICS starts transaction
'EXTR' to process the queue12
So a TD queue is a work pipe with a built-in consumer, which is how batch-like follow-on processing gets
kicked off from online activity. CICS's own system messages go to a TD queue (CSMT) for the same reason.
CSMT
13
Choosing between them.
TS re-read, rewrite, random access by item, outlives the task.
Paging, scratchpad, passing data between unrelated tasks.
TD sequential, read-once, can trigger a transaction.
Logging, queuing work for downstream processing.14
If you need to read item 15 twice, it is TS. If you want something to happen when data arrives, it is TD.
15
What the interviewer is probing.1. "What is the difference between TS and TD queues?" Probing: the distinction. Stalls:
"Both are queues." Moves up: TS is randomly readable and rewritable and items persist until
deleted; TD is strictly sequential and an item is gone once read.
16
2. "When would you use a TD queue?" Probing: the fit. Stalls: "For storage." Moves up: for
logging and for triggering — an intrapartition TD queue can start a transaction when a trigger level
is reached.
17
3. "What is the hazard with TS queues?" Probing: experience. Stalls: "None." Moves up:
queues that are never deleted accumulate and fill the TS dataset, which is a real cause of
region-wide outages.
18
4. "Where should a TS queue live?" Probing: the detail. Stalls: "Anywhere." Moves up: main
storage for short-lived small data, auxiliary for anything larger or that must survive a restart.