Summary -

In this topic, we described about the below sections -

Read data from a temporary storage queue. READQ TS retrieves data from a temporary storage queue that is stored in either main or auxiliary storage.

Syntax -

READQ TS Syntax

INTO(data-area) -

Specifies the data area to where the data to be written. The data area can be any variable, array or structure.

ITEM(number) -

number is a halfword binary value. Specifies the item number of the logical record to be retrieved from the queue.

LENGTH(record-length) -

Record-length is a halfword binary value. Specifies the length of the record to be read. If INTO option specified, LENGTH need not be specified.

If LENGTH need to be specified with INTO, specify as the maximum length of data that the program accepts.

If the length of the data exceeds the value that is specified, the data is truncated to that value and the LENGERR condition occurs. If SET option coded, the LENGTH must be specified.

NEXT -

Specifies retrieval for the next sequential logical record following the last retrieved record or the first record if no previous record has been retrieved.

NUMITEMS(number) -

Number is a halfword binary field. CICS stores a number that indicates how many items there are in the queue to the number field. This occurs if the command completes normally.

QNAME (name) -

Specifies an alternative to QUEUE, QNAME. Specifies the symbolic name (1 - 16 characters) of the queue to be read from. The name should have 16-characters and padded with spaces if the length field has less than 16-characters.

Temporary Storage Queue can be created with dynamic names to avoid duplicate queues creation. Temporary Storage Queue name would be a combination of symbolic name (Program name most of the cases) and the timestamp (current time portion).

Ex - TEMPPROG11060309

If the queue defined as remote in CICS, the request will be transferred to remote system. If no SYSID is present, then based on the TST definition the Queue will be decided whether it is a local or remote. If SYSID presents, then system won’t check for TST entries and directly assumes that the queue is Remote one.

QUEUE (name) -

Specifies the symbolic name (1 - 8 characters) of the queue to be read from. The name should have 8-characters and padded with spaces if the length field has less than 8-characters. If the queue defined as remote in CICS, the request will be transferred to remote system.

SET(ptr-ref) -

Specifies the pointer reference that is set to the address of the retrieved data. The pointer reference is valid until the next READQ TS command or the end of task if not changed by other commands or statements.

SYSID (system-name) -

Option is for remote and shared queues only. Specifies the system name (1 - 4 characters).

Error Conditions -

Below are the list of error conditions may occur in combination. If more than one occurs, only the first is passed to the application program.

Error ConditionRESP2, Description & SolutionSystem Action
16 INVREQ Queue name specifies consisting of binary zeroes or queue created by CICS internal code.
Solution: -If queue name consists binary zeroes, modify the queue name and try again.If the queue is created by CICS internal code, use some other name for TSQ and try again.
Task abnormally terminated
17 IOERR 5 - There is an irrecoverable input/output error for a shared queue.
Solution: -This might be due to the memory access problem. Try after some time and the issue still exists, contact the storage support group to resolve the issue.
Task abnormally terminated
26 ITEMERR The ITEM number provided is out of range or attempt made to read beyond the end of queue using NEXT.
Solution: -TSQ supports only 32767 items can written to the queue. Modify the program to check the item number before the reading queue with NEXT.
Task abnormally terminated
22 LENGERR The retrieved data area length is more than the specified length in LENGTH. This only happens for INTO not to SET.
Solution: -The specified length value should be same as the retrieved data area length. If using INTO option, the LENGTH should be specified. If you are not aware of the length, use maximum record length.
Task abnormally terminated
70 NOTAUTH A resource security check has failed on QUEUE (name).
Solution: -Contact system administrator team to check whether the appropriate access added for the user or group. It will resolve the problem.
Task abnormally terminated
44 QIDERR Occurs when the queue specified cannot be found in Main storage, Auxiliary storage.
Solution: -This happens due to the Queue already might get deleted or queue name provided might wrong. Debug the application program flow and correct the logic.
Task abnormally terminated
53 SYSIDERR 4 - Occurs in any of the following situations:
  • The specified SYSID name is not the local system or a remote system.
    Solution: -The specified SYSID name is not related to any system. Correct it if required.
  • The link to the remote system is closed.
    Solution: -This might be due to the remote system is not up and running. Contact remote system support team.
  • The CICS region specified fails to connect to the TS server supports the referenced temporary storage queue.
    Solution: -This issue due to the connectivity issue. Restart the CICS region might solve the issue. Otherwise, contact the system administrator to resolve the issue.
Task abnormally terminated