# AEIZ: ITEMERR not handled

Source: https://wndsoftware.com/mainframe-errors/aeiz

### AEIZ: ITEMERR not handled

An AEIZ abend means a temporary storage command raised the ITEMERR condition and the program didn't handle it. ITEMERR means the item number was out of range, usually because the program read past the last item in a TS queue.


#### Other names for this code

Also written as `AEIZ abend`, `CICS AEIZ`, `abend AEIZ`, `ITEMERR`, `CICS ITEMERR`, `AEIZ ITEMERR`, `TS queue ITEMERR`.


### What it means

A CICS temporary storage queue holds numbered items, starting at 1. READQ TS reads one, either by number with ITEM or with NEXT, which reads the item after the last one read. WRITEQ TS adds an item, or replaces one when it codes REWRITE and ITEM.

ITEMERR means the item number didn't work. A READQ TS asked for an item past the end of the queue, a READQ TS NEXT was issued after the last item had been read, or a WRITEQ TS REWRITE named an item that isn't there. WRITEQ TS can also raise ITEMERR when the queue already holds the maximum number of items. A queue that doesn't exist at all raises a different condition, QIDERR.

The default action for ITEMERR is to abend the task with AEIZ. A program that codes `RESP(WS-RESP)`, which implies NOHANDLE, gets control back and can test for `DFHRESP(ITEMERR)`. Older programs use `HANDLE CONDITION ITEMERR(paragraph)`. In a loop that reads a queue with NEXT, ITEMERR is the normal sign that the loop is done. IBM APAR PK70901 describes an AEIZ from an unhandled ITEMERR on WRITEQ TS in an MQ exit.


### Common causes

- A loop reads a TS queue with NEXT and doesn't stop when ITEMERR comes back after the last item.
- An item counter is off by one, for example it starts at 0, or it was saved in the COMMAREA and is now stale.
- Two tasks read the same queue with NEXT. The read position belongs to the queue, so each task's NEXT moves it for the other.
- An earlier step deleted the queue and rebuilt it with fewer items, but the program still asks for a higher item number.
- A queue that is never deleted keeps growing until WRITEQ TS can't add more items.


### How to find the problem

- The terminal message `DFHAC2206` names the transaction. In the dump, EIBFN shows the TS command and EIBRSRCE the queue name. Long queue names are cut short in EIBRSRCE.
- Browse the queue with CEBR to see how many items it holds and what is in them.
- Run the transaction under CEDF and note the ITEM value on the failing READQ TS or WRITEQ TS.
- Check whether another transaction uses the same queue name. Names built from the terminal ID or user ID are easy to share by accident.


### How to fix it

- Treat `DFHRESP(ITEMERR)` as end of queue in read loops. Code `RESP(WS-RESP)` on the READQ TS and leave the loop when it comes back.
- Use the NUMITEMS option on READQ TS to get the item count, and read by explicit item number instead of NEXT when more than one task may read the queue.
- Give each conversation its own queue name, for example with the terminal ID in it, and delete the queue with DELETEQ TS when the work is done.
- If a queue really needs to grow without limit, split it into several queues or move the data to a file.


### What it looks like


```text
DFHDU0203I 10/18/2026 13:18:09 CICSPRD1 A transaction dump was taken for dumpcode: AEIZ, Dumpid: 1/0058.
DFHAC2206 13:18:09 CICSPRD1 Transaction ORDL failed with abend AEIZ. Updates to local recoverable resources backed out.
```


### IBM documentation

[IBM documentation: AEIZ](https://www.ibm.com/docs/en/cics-ts/6.x?topic=codes-aeiz). Use the documentation for your installed release.

[Report a correction to WND Software](https://wndsoftware.com/contact#message).

Last reviewed 2026-10-18 by the WND Software team. Written in our own words. For the full reference, check IBM’s CICS documentation for your release.


### Related codes

[AEYH QIDERR not handled Read →](https://wndsoftware.com/mainframe-errors/aeyh)
[AEIV LENGERR not handled Read →](https://wndsoftware.com/mainframe-errors/aeiv)
[AEIP INVREQ not handled Read →](https://wndsoftware.com/mainframe-errors/aeip)
[AEIM NOTFND not handled Read →](https://wndsoftware.com/mainframe-errors/aeim)
[AEIQ IOERR not handled Read →](https://wndsoftware.com/mainframe-errors/aeiq)

### Questions


#### What is the difference between ITEMERR and QIDERR?

QIDERR means the queue doesn't exist. ITEMERR means the queue exists but the item number asked for isn't in it, or the queue is full.


#### Is ITEMERR normal when reading a queue?

Yes, in a loop that reads with NEXT. It is how CICS tells the program there are no more items, so the program should expect it.


#### Why did a NEXT loop skip items or end early?

Probably because another task read the same queue with NEXT. The read position is shared, so each task moves it for the other.

[CICS transaction abends](https://wndsoftware.com/mainframe-errors/cics-abends) · [AEIW](https://wndsoftware.com/mainframe-errors/aeiw) · [AEXY](https://wndsoftware.com/mainframe-errors/aexy)

[← All error codes](https://wndsoftware.com/mainframe-errors/)
