What is the command for reading a record form a TSQ?

Answers were Sorted based on User's Feedback



What is the command for reading a record form a TSQ?..

Answer / srivani dorbala

EXEC CICS READQ TS
QUEUE('QNAME')
INTO(WS-TSQ-REC)
ITEM(Q-ITEM)
LENGTH(LENGTH OF WS-TSQ-REC)
END-EXEC.

WHERE QNAME IS ANYNAME OF TSQ WHICH SHOULD B 8 CHARACTERS.
WS-TSQ-REC WHICH IS A RECORD DECLARED IN WORKING STORAGE
SECTION AND Q-ITEM IS A WORKING STORAGE VARIABLE WHICH HAS
PIC S9(04) COMP VALUE 0.EVERY TIME THIS ITEM IS INCREASING
BY 1.

IF U HAVE ANY DOUBT, PLEASE SHARE WITH ME.

Is This Answer Correct ?    25 Yes 2 No

What is the command for reading a record form a TSQ?..

Answer / hems

Temporary Storage Queues:

The temporary program (TSP) provides the application
program with an ability to do store and retrieve the data
in a temporary storage queue (TSQ)

TSQ can be used as scratch pad memory.

TSQ can be created and deleted dynamically by an
application program without specifying anything in CICS
control tables.

Temporary storage queue which are to recovered in the event
of failure should be registered in TST (Temporary Storage
Table)

A TSQ is identified by the queue id (1 to 8 bytes).

A record in a TSQ can be read any number of times, they can
be read both sequentially and randomly and records in a TSQ
can also be updated.

TSQ can be written in the main storage or in the auxiliary
storage. If the TSQ is written in main storage, accessing
TSQ is very fast but TSQ in this mode is not recoverable.

TSQ which is written in auxiliary storage (external VSAM
file) can be recoverable.

WRITEQ TS Command

EXEC CICS WRITEQ
QUEUE (name)
FROM (data-area)
LENGTH (data-value)
ITEM (data-area)
REWRITE
MAIN / AUXILIARY
NOSUSPEND
END-EXEC.

The WRITEQ command is used to write a record (item) in a
TSQ.

LENGTH indicates the length of data records. It is a half
word binary (S9(4) COMP)
ITEM specifies the relative position number. It is defined
as a half word binary (S9(4) COMP)
MAIN : specifies main storage.
AUXILIARY : specifies auxiliary storage. This is default.
REWRITE : Option is used to rewrite a record in a TSQ,
which has been read.
NOSUSPEND : If no space is detected in the TSQ for the
new record, CICS will return the control to the next
statement after the WRITEQ command instead of suspending
the task if NOSUSPEND is specified in the WRITEQ command.

At the end of the write command CICS places item number of
the record written into ITEM parameter.

Exceptional condition to WRITEQ are:
NOSPACE Sufficient space is not available. The default
action is suspend the task untill space is available.

READQ TS Command

EXEC CICS READQ
QUEUE (name)
INTO (data-area) / SET (data-area)
LENGTH (data-area)
ITEM (data-value) / NEXT
END-EXEC.

The READQ command is used to read all the records in a TSQ
sequentially or to read a particular record randomly.

INTO determines the area to which the record data is to be
placed.
LENGTH indicates the length of the record to be read.
ITEM indicates item number of the record to be read.
SET option can also be used instead of INTO option.

Other options of the READQ command is

NUMITEMS Specify NUMITEMS (data-area) in READQ command.
The data area defined as S9(4) COMP. At the completion of
the read command, CICS will place the actual number of the
records in the TSQ specified.

NEXT if this option is specified, task will read the
next sequential record in the TSQ
specified. This option should be used very carefully.

Exceptional conditions are
QIDERR : The specified QID is not found.
ITEMERR : The specified item number is not found. For
sequential read it indicates end
of the queue.

DELETEQ TS Command

EXEC CICS DELETEQ TS
QUEUE (name)
END-EXEC.

The DELETEQ command is used to delete a TSQ entirely.
Cannot delete a single item from the TSQ.

Exceptional conditions are
QIDERR : The specified QID is not found.

Is This Answer Correct ?    10 Yes 2 No

What is the command for reading a record form a TSQ?..

Answer / thomas abraham green

Hi sreevani .. this is a very brilliant answer give.. i
have 10 years experiance in Mainframes and i appretiate you
way of giving apt answer. Please gimme your contact details
i can reffer you for a job with 09 lakhs package per annum.
Please let me know if you are interested.

Is This Answer Correct ?    4 Yes 15 No

Post New Answer

More CICS Interview Questions

I have to run a select query on DB2 table and show its data on CICS map. Please tell me.

2 Answers  


Define the term transaction routing?

0 Answers  


Is it possible start a transaction CICS from job Batch? How do it?

5 Answers   CSC,


Explain how DSECT parameter is used in BMS ?

0 Answers  


difference between tsq and tdq?

0 Answers   IBM,






Explain the use of DCT ?

0 Answers  


We can allocate memory dynamically by using GET MAIN command my question is at what scenario we can't release this memory and reuse this same memory??

0 Answers   BirlaSoft,


What are the naming conventions for the Temporary Storage Queues?

2 Answers   Sainsburys,


when an xctl is done, does the tranid change ? Is a new task created ? Does it cause an implicit syncpoint to be issued ?

0 Answers   IBM,


What is the primary function of the Processing Program Table (PPT)?

5 Answers   IBM,


What is meant by an AICA ABEND?

0 Answers  


What is the tcp in the cisc?

0 Answers  


Categories