Você está na página 1de 25

CICS queues: TSQ & TDQ


1. Introduction to TSQ and why we need to use Q’s

a. Temporary storage Queues
b. Transient data Queues

2. How to view Q’s in CICS region

Contents to be discussed

Temporary storage Queues

 Concept of TSQ with example.

a) Practical example of TSQ
b) Use of TSQ to browse pages.
c) Examples supporting the same.

Transient Queues

 What are transient data Q’s and explain the usage of the same
 Explain use of CEBR command and how to use it.
Introduction cont..

 It is created and deleted dynamically by application program

without specifying anything in the CICS Control table as long as
recovery of data is not required.
 We can use TSQ as a scratch pad.
 TSQ is defined by Q id (1 to 8 bytes) and a record within a
 TSQ is identified by the relative position number called the Item
 A TSQ having Q ID = MFCOPTSQ
Item No 1 2 3 4
rec1 rec2 rec3 rec4
Concept of TSQ’s

 The records in TSQ once written remain accessible until the entire
TSQ is explicitly deleted. They can be read , repeatedly read and
even updated.
 TSQ regardless of where it resides can be accessed by any
transaction in the same CICS region.
3. Same transaction
 From same terminal
 From different terminal
4. Different transaction
 From same terminal
 From different terminal
Types of TSQ’s

Two types of queues:

 NON- Recoverable TSQ are the one which is created and deleted
dynamically by CICS application.
 Recoverable TSQ are the one for which the entries should be made
in the temporary storage table.
Concept of TSQ’s Cont..

Q id
The terminal id should be included (for terminal dependent
Task, pseduconversational) in Q id in order to ensure that
TSQ is unique to that task. If TSQ has to be shared then we
can use COMM in place of Term id
Commands Available:
 WRITEQ TS - To write or rewrite a record in TSQ
 WRITEQ - (with rewrite option)- Update a record
 READQ TS - To read a record in a TSQ
 DELETEQ TS - To delete a TSQ (all records will be deleted)
Practical example

 Each sales agent runs an application (on transaction A) and confirms sales to
customers in real time to preserve critical response times
 Each transaction adds the data associated with the sale orders to queues for
later processing
 The larger task of processing the order is split into billing, shipping, and
updating inventory applications
 These applications run separately from the initial order-taking application,
as transactions on transaction B. These transactions dequeue the data that
they are to process.
Practical use of TSQ’s
Scrollable screens
Flow diagram cont..
Scrollable screens
In Brief

 We are writing all data to queue

 This particular screen has 15 records in one page, so item no 1 of
queue has 15 lines data and as we finish writing 15 lines on item no 1
of Q we increment page index by one i.e item no by one and again
start writing the next 15 lines and so on until we have the full data
Applications of TSQ

 Data passing among transaction

 Review mode in multiple screens.

We can save the screen data in TSQ and later retrieve it for review and

 Report printing:- One transaction accumulates report data in TSQ

and then initiates other transaction to print the report
Concept of TDQ

Transient Data Queue

 Transient data is sometimes called Transient data Queue(TDQ), it is also
called as transient data destination
 ”Queue” word describes that the data is put together in sequential mode
and “destination” indicates that it is directed to transactions/
destinations.(data can only be read sequentially)
 Unlike temporary storage queues, transient data queues must be defined
before they are used. This definition takes place in a special CICS table
called the Destination Control Table (DCT). The DCT is usually maintained
by a system program
Intrapartition TDQ

An Intrapartition TDQ is a a group of sequential records which are

produced and processed by the same / different transactions within
CICS region
Intrapartition queues may also be associated with Automatic Task
Initiation. When the number of records in an Intrapartition queue
reaches a predefined count a special task is automatically initiated
Extrapartition TDQ

Unlike Intrapartition queues, extrapartition queues can be accessed

by other CICS programs as well as batch programs executing outside
of the CICS partition or region
This TDQ is a separate physical file and can reside on any sequential
device, such as disk or tape. Reading records in an extrapartition
queue is non-destructive
Commands available

 The WRITEQ TD command allows you to write records sequentially to a

transient data queue
 The READQ TD - read sequentially
 The DELETEQ TD - delete the contents. This is not valid for
Extrapartition TDQ’s.
Applications of TDQ

 Intrapartition TDQ’s:
 Interface among CICS screens
Appli. Prog. 1--->TDQ--->Appli prog2--->reports
 Automatic task initiation
 Extrapartition TDQ’s:
 Interface to Batch TSO
CICS prog -->TDQ--> File---> Batch Prog
 Interface from batch
Batch prog----> file--->TDQ---->CICS Appli Prog
Automatic task initiation

 One of the application of TDQ (Intrapartition) is ATI

 It is a facility through which a CICS transaction can be initiated
 The No of records in the Intrapartition TDQ triggers the transaction


DESTID=MSGS Mesgs are accumulated in this TDQ.
TRANSID=MSW1  start this transaction.
Temporary storage queues can be created any Transient data queues must be defined to a
time that an application needs to write to a CICS region before it starts up
queue(non recoverable)

Elements in temporary storage queues can be Transient data queues must be read
read either sequentially or directly. They can be sequentially, and each element can be read
read any number of times and are never only once. (After a transaction reads an
removed from the queue until the entire queue element, that element is removed from the
is purged queue and is not available to any other

TSQ can be written to Auxiliary or Main Storag TDQ is written to Disk

An application uses TSQ 's to pass info' from While a TDQ to accumulate records before
task to task processing or send data for external use,
such as a print operation or other
Browsing Queue: CEBR
How are we Benefited?

1. Today we have learnt how TSQ’s can be effectively utilized to

scroll pages.

3. We also now know that the technique coded once can act as
reusable component in future programs involving same technique.