What it means
RESP 23 (QZERO) means the queue being read is empty or its end has been reached. A READQ TD removes the record it reads, so a program that drains a queue reaches QZERO when it has read everything.
IBM advises programs started by automatic transaction initiation (ATI) to test for QZERO so the task ends only when the queue is empty. If the condition is not handled, the default action is to end the task abnormally.
Typical causes
- The program has read every record that was on the queue (a read removes the record).
- The end of the queue was reached while reading.
- An I/O error on a queue that cannot then be read can also surface as QZERO, according to the IOERR description of READQ TD.
How to fix it
- Test RESP after every READQ TD and leave the read loop on QZERO.
- In an ATI task, test for QZERO so the task ends only when the queue is empty.
- Add RESP so QZERO does not end the task abnormally.
Example
Illustrative only; names and values are invented.
EXEC CICS READQ TD QUEUE('LOGQ') INTO(WS-REC) LENGTH(WS-LEN)
RESP(WS-RESP) END-EXEC
IF WS-RESP = DFHRESP(QZERO)
SET WS-QUEUE-EMPTY TO TRUE
END-IF