queues in cics_with paging logic

25
CICS queues: TSQ & TDQ

Upload: mainframe-for-everyone

Post on 17-Nov-2014

1.954 views

Category:

Documents


1 download

DESCRIPTION

Queues in CICS_With Flow for Paging logic

TRANSCRIPT

Page 1: Queues in CICS_With Paging logic

CICS queues: TSQ & TDQ

Page 2: Queues in CICS_With Paging logic

Agenda

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

Page 3: Queues in CICS_With Paging logic

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.

Page 4: Queues in CICS_With Paging logic

Introduction

Page 5: Queues in CICS_With Paging logic

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 number A TSQ having Q ID = MFCOPTSQ

Item No 1 2 3 4

rec1 rec2 rec3 rec4

Page 6: Queues in CICS_With Paging logic

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.

1. Same transaction From same terminal From different terminal

2. Different transaction From same terminal From different terminal

Page 7: Queues in CICS_With Paging logic

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.

Page 8: Queues in CICS_With Paging logic

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:

1. WRITEQ TS - To write or rewrite a record in TSQ

2. WRITEQ - (with rewrite option)- Update a record

3. READQ TS - To read a record in a TSQ

4. DELETEQ TS - To delete a TSQ (all records will be deleted)

Page 9: Queues in CICS_With Paging logic

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.

Page 10: Queues in CICS_With Paging logic

Practical use of TSQ’s

Page 11: Queues in CICS_With Paging logic

Scrollable screens

Page 12: Queues in CICS_With Paging logic
Page 13: Queues in CICS_With Paging logic

Flow diagram cont..

Page 14: Queues in CICS_With Paging logic

Scrollable screens

Page 15: Queues in CICS_With Paging logic

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 written

Page 16: Queues in CICS_With Paging logic

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 correction

Report printing:- One transaction accumulates report data

in TSQ and then initiates other transaction to print the report

Page 17: Queues in CICS_With Paging logic

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

Page 18: Queues in CICS_With Paging logic

Intrapartition TDQ

An Intrapartition TDQ is a a group of sequential records which

are produced and processed by the same / different

transactions within CICS regionIntrapartition 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

Page 19: Queues in CICS_With Paging logic

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 regionThis 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

Page 20: Queues in CICS_With Paging logic

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.

Page 21: Queues in CICS_With Paging logic

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

Page 22: Queues in CICS_With Paging logic

Automatic task initiation

One of the application of TDQ (Intrapartition) is ATI It is a facility through which a CICS transaction can be initiated

automatically. The No of records in the Intrapartition TDQ triggers the

transaction initiation.

DFHDCT TYPE = INTRA

DESTID=MSGS Mesgs are accumulated in this TDQ.

TRANSID=MSW1 start this transaction.

TRIGLEV=10000

Page 23: Queues in CICS_With Paging logic

TSQ Vs TDQT S Q T D Q

T e m p o r a r y s t o r a g e q u e u e s c a n b e c r e a t e d a n y t im e t h a t a n a p p l ic a t io n n e e d s t o w r i t e t o a q u e u e ( n o n r e c o v e r a b le )

T r a n s ie n t d a t a q u e u e s m u s t b e d e f in e d t o a C IC S r e g io n b e f o r e i t s t a r t s u p

E le m e n t s in t e m p o r a r y s t o r a g e q u e u e s c a n b e r e a d e i t h e r s e q u e n t ia l ly o r d ir e c t ly . T h e y c a n b e r e a d a n y n u m b e r o f t im e s a n d a r e n e v e r r e m o v e d f r o m t h e q u e u e u n t i l t h e e n t i r e q u e u e is p u r g e d

T r a n s ie n t d a t a q u e u e s m u s t b e r e a d s e q u e n t ia l ly , a n d e a c h e le m e n t c a n b e r e a d o n ly o n c e . ( A f t e r a t r a n s a c t io n r e a d s a n e le m e n t , t h a t e le m e n t is r e m o v e d f r o m t h e q u e u e a n d is n o t a v a i la b le t o a n y o t h e r t r a n s a c t io n . )

T S Q c a n b e w r i t t e n t o A u x i l ia r y o r M a in S t o r a g T D Q is w r i t t e n t o D is k

A n a p p l ic a t io n u s e s T S Q ' s t o p a s s in f o ' f r o m t a s k t o t a s k

W h i le a T D Q t o a c c u m u la t e r e c o r d s b e f o r e p r o c e s s in g o r s e n d d a t a f o r e x t e r n a l u s e , s u c h a s a p r in t o p e r a t io n o r o t h e r

Page 24: Queues in CICS_With Paging logic

Browsing Queue: CEBR

Page 25: Queues in CICS_With Paging logic

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

to scroll pages.

2. We also now know that the technique coded once can act as

reusable component in future programs involving same

technique.

How are we Benefited?