TSQ and TDQ in CICS

TSQs—>

Temporary Storage Ques are important CICS storage facility to store data that must be available to other transactions in the same region.
Records stored in TSQs are called as ITEMs and can be referred seq. or directly by using the ITEM number.
Remains in the storage until it gets deleted or COLD start.
These can be set to delete automatically by settign expiry interval in TSMODEL resource information.
It can exist on main storage, Auxiliary storage, or shared temp. storage pools in z/os coupling facility.

Advantages ->
– No need to allocate Temp. storage until it is required.
– We can keep it as long as we required.
– SIZE is not fixed until you issue a command to create it.
– Good choice for relatively high Volumes.

Disadvantages->
– It required more Processor Use.
– For every execution of TSQ, need to use exec CICS command which internally access Index. Thus it requires more       processor use.

WRITEQ  Example

WRITEQ TS QNAME(q1)
     from (ww-data)
     length(len1)
     NUMITEMS(ww-data-area)
     ITEM(item num)
     AUXIALRY/MAIN
     SYSID()
     SUSPEND/NOSUSPEND

NUMITEMS- specifies the number of items that are in Q.

NOSUSPEND – This is to prevent the application program from suspending in case of NOSPACE condition occurs while writing the Q.

TDQ’s—>

TDQs are generally used for auto Transaction initiation process. While defining TDQs in DCT entry, TRIGGER level parameter exceeds Transaction coded in DFHDCT gets initialed automatically.
– TDQs used to accumulate data before processing.
– Needs to be predefined
– Read is destructive after a record read, it will be deleted.
– Only Sequential read
– Intra & Extra TDQs

Difference Between TSQ & TDQs–>

– No need of pre-defining, TDQs needs to be defined in DCT.
– Read is not destructive , Destructive.
– Can be accessed Seq. or directly. Only sequential access is possible.
– TSQs can be opened INPUT and OUPUT mode. TDQs can not be opened in both input & output mode in same prog.

TSQ Example usage:

Customer details screen which has Customer number,Type, Account type etc are the inputs.
Below are the functions for that screen.

ENTER=INQUIRY PF1=HELP PF3=EXIT F4=UPDATE PF9=DELETE

Here each time user presses PF1, seperate help module gets called and a help screen gets displayed(Map2) and PF3 from there takes the control back to the Customer details screen(Map1).

But after coming back to customer details screen, it should display the customer details without the need to enter the input details again.This can be achieved by storing the data between the two programs and it can be done using TSqs.

Before calling to Help program store the input details in a TSQ using WriteQ. After coming back from the Help program, Read the TSq and get the input details and display it on the screen.

 

Add a Comment

Your email address will not be published. Required fields are marked *

Close Bitnami banner