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

Module 7: CICS Temporary Storage and Transient Data


WRITEQ TD

The WRITEQ TD command puts one record onto a transient data queue. It is the "send" side of transient data: logging, printing and message switching all start here.

Syntax and options

  • QUEUE or QNAME - the symbolic destination name of the TD queue, for example 'PRT1'.
  • FROM - the data area holding the record to write.
  • LENGTH - the length of the record being written. Needed for variable-length records.
  • The queue must already be defined to CICS with a TDQUEUE resource definition; WRITEQ TD never creates a queue.

Writing to intrapartition queues

  • Records go to the CICS-managed intrapartition data set, in arrival order.
  • Each write can count toward the queue's trigger level. When the level is reached, CICS starts the trigger transaction.
  • Intrapartition queues can be non-recoverable, physically recoverable or logically recoverable, set in the queue definition.

Writing to extrapartition queues

  • Records go outside the region: to a sequential data set, a tape, or a printer.
  • This is how CICS hands data to batch programs: write the records now, let the batch job read the data set later.
  • The record format, fixed or variable length, is fixed in the TDQUEUE definition, so the FROM area must match it.

Example:-

WORKING-STORAGE SECTION. 01 OUTAREA PIC X(132). 01 OUTLNG PIC S9(4) COMP VALUE +132. 01 RESPONSE-CODE PIC S9(8) COMP. PROCEDURE DIVISION. MOVE 'INVOICE 88412 TOTAL 1,250.00' TO OUTAREA. EXEC CICS WRITEQ TD QUEUE('PRT1') FROM(OUTAREA) LENGTH(OUTLNG) RESP(RESPONSE-CODE) END-EXEC. IF RESPONSE-CODE NOT = DFHRESP(NORMAL) PERFORM 9999-HANDLE-TD-ERROR END-IF.






© copyright mainframebug.com
Privacy Policy
MainframeBug Assistant