MainframeKit

ITEMERR

DFHRESP(ITEMERR) = 26CICS RESP CONDITION

The temporary storage item number is not valid, or a read went past the last item.

MOST LIKELY

Reading item n when the queue has fewer items.

FIRST CHECK

Treat ITEMERR on a NEXT read as the end of the queue.

TRY IT ▸

MainframeKit assistant

What it means

ITEMERR comes from temporary storage commands. On READQ TS it means the item number does not exist or a NEXT read went past the end of the queue.

Programs that read a queue in a loop often use ITEMERR as the end-of-queue signal.

Typical causes

  • Reading item n when the queue has fewer items.
  • Reading with NEXT after the last item has already been read.
  • Wrong item number kept in working storage or the COMMAREA.

How to fix it

  1. Treat ITEMERR on a NEXT read as the end of the queue.
  2. Check the item number before reading.
  3. Code RESP (and RESP2) on the command and test the value with DFHRESP.

Example

Illustrative only; names and values are invented.

EXEC CICS READQ TS QUEUE('TSQ1') INTO(WS-ITEM) NEXT
     RESP(WS-RESP) END-EXEC
IF WS-RESP = DFHRESP(ITEMERR) => end of queue