CICS abend

AEIM: NOTFND not handled

An AEIM abend means a CICS file control command, such as READ, looked for a record by key, no record with that key existed, and the program didn't handle the NOTFND condition that CICS returned.

Also written as AEIM abend, CICS AEIM, abend AEIM, NOTFND, CICS NOTFND, AEIM NOTFND, record not found CICS.

What it means

AEIM is the abend for an unhandled NOTFND condition. NOTFND means a file control command looked for a record by its key and there was no record with that key. READ, DELETE with a key, STARTBR and RESETBR can all return it.

A missing record is usually normal business. It might be a new customer or a mistyped account number, so most programs expect it. The abend happens when the code assumes the record is always there. If the command has a RESP(WS-RESP) option, CICS returns control with the condition in WS-RESP, and the program can test it against DFHRESP(NOTFND). An older program might use HANDLE CONDITION NOTFND(paragraph) to jump to a paragraph instead. With neither in place, the default action for NOTFND is to abend the task with AEIM.

Common causes

  • The user entered a key that doesn't exist, and the program has no RESP check or HANDLE CONDITION for NOTFND.
  • The key is built wrongly. Missing leading zeros, spaces instead of zeros, a field moved into the wrong position of the key, or the wrong KEYLENGTH on a generic read all produce a key that matches nothing.
  • The program reads the wrong file. The FILE name comes from a variable with the wrong value, or the FILE definition in this region points at a different data set, such as test data in a production region.
  • Another task or a batch job deleted the record between two steps of the transaction.

How to find the problem

  1. The terminal message DFHAC2206 names the transaction. In the transaction dump, the EIB shows the failing command in EIBFN and the file name in EIBRSRCE.
  2. Run the transaction under CEDF. It stops on each file command and shows the RIDFLD key it sent, and you can look at it in hex. Comparing that with the real key in the file usually shows the mistake quickly.
  3. Check the data set. Use File Manager or an IDCAMS PRINT with FROMKEY and TOKEY to see whether a record with that key exists.
  4. Run CEMT INQUIRE FILE(name) to see which data set the CICS file points to in this region.

How to fix it

  • Handle the condition. Code RESP(WS-RESP) on the READ, then test WHEN DFHRESP(NORMAL) and WHEN DFHRESP(NOTFND) in an EVALUATE. Show the user a message such as 'Account not found' instead of ending the task.
  • Fix the code that builds the key so its format matches the file exactly, including padding and numeric format.
  • If the FILE definition points at the wrong data set, the CICS systems programmers need to correct it.
  • AEIM is almost always fixed by the application team.

What it looks like

DFHDU0203I 10/12/2026 10:44:12 CICSPRD1 A transaction dump was taken for dumpcode: AEIM, Dumpid: 1/0018.
DFHAC2206 10:44:12 CICSPRD1 Transaction CUS2 failed with abend AEIM. Updates to local recoverable resources backed out.

Questions

Is AEIM a data problem or a program problem?

Usually a program problem. A missing record is an expected outcome, and the program should handle NOTFND. It's a data problem only when the record really should exist and doesn't.

Does reaching the end of a browse cause AEIM?

No. Running out of records on READNEXT or READPREV raises ENDFILE, a different condition. Left unhandled, it ends the task with AEIT.

Is NOTFND the CICS version of SQLCODE +100?

They play the same role. Both mean the request was valid but no matching row or record was found, and good programs check for them.