AEI9: MAPFAIL not handled
An AEI9 abend means an EXEC CICS RECEIVE MAP got no usable data from the screen and the program didn't handle the MAPFAIL condition. The usual causes are the user pressing CLEAR or a PA key, or pressing Enter without changing any field.
Other names for this code
Also written as AEI9 abend, CICS AEI9, abend AEI9, MAPFAIL, CICS MAPFAIL, AEI9 MAPFAIL, RECEIVE MAP MAPFAIL.
What it means
RECEIVE MAP takes the data the terminal sent and places it into the program's symbolic map. A 3270 terminal only sends fields whose modified data tag (MDT) is on, which normally means the user typed in them. When there is nothing to map, CICS raises MAPFAIL.
IBM lists when that happens. The user pressed CLEAR or a PA key, which send no field data. The user pressed Enter or a PF key, no field had its MDT on, and the cursor wasn't in a named field of a map defined with CURSLOC=YES. No SEND MAP formatted the screen first. Or the map being received isn't the one that was sent.
The default action for MAPFAIL is to abend the task with AEI9. A program that codes RESP(WS-RESP) gets control back and can test for DFHRESP(MAPFAIL). After a MAPFAIL, CICS doesn't clear the input map to nulls, so code that expects a clean map has to check the response first. If a HANDLE AID is active for the key the user pressed, control goes to that label ahead of any HANDLE CONDITION MAPFAIL label.
Common causes
- The user pressed Enter on a screen without typing anything, and none of the map's fields were sent with the MDT already on.
- The user pressed CLEAR or a PA key, often while trying to get out of the transaction.
- On the first run of a pseudo-conversational transaction, the program issues RECEIVE MAP before any SEND MAP. It doesn't check EIBCALEN for zero to spot the first entry.
- The program receives a different map from the one it sent, for example after a change to the mapset.
- A program that used HANDLE CONDITION MAPFAIL also has a HANDLE AID, which took control first and skipped the MAPFAIL logic.
How to find the problem
- The terminal message
DFHAC2206names the transaction. In the dump, EIBFN shows RECEIVE MAP and EIBRSRCE the map name. - Check EIBAID in the dump. Compare it with the values in the DFHAID copybook, such as DFHENTER, DFHCLEAR and DFHPA1, to see which key the user pressed.
- Check EIBCALEN. A value of zero means this was the first time into the program, so the screen was never formatted by it.
- Run the transaction under CEDF, repeat the user's steps, and watch the RECEIVE MAP response.
How to fix it
- Test EIBCALEN at the start of the program. If it is zero, send the map first and RETURN with a TRANSID instead of receiving.
- Check EIBAID before RECEIVE MAP. Handle CLEAR and the PA keys directly, for example by ending the session or redisplaying the screen.
- Code
RESP(WS-RESP)on RECEIVE MAP. On MAPFAIL, resend the map with a message such as 'Enter data or press PF3 to exit'. Use MAPONLY to resend it without data. - If a field must always come back, send it with the MDT already on, using FSET in the map or the attribute byte.
- Define the map with CURSLOC=YES if cursor position alone should count as input.
What it looks like
DFHDU0203I 10/18/2026 15:48:02 CICSPRD1 A transaction dump was taken for dumpcode: AEI9, Dumpid: 1/0112. DFHAC2206 15:48:02 CICSPRD1 Transaction MENU failed with abend AEI9. Updates to local recoverable resources backed out.
IBM documentation
IBM documentation: AEI9. Use the documentation for your installed release.
Related codes
Questions
Why MAPFAIL when the user only pressed Enter?
A 3270 sends only fields whose modified data tag is on. If the user typed nothing and no field was sent with the tag already set, there is no data for RECEIVE MAP to map.
Is the input map cleared after MAPFAIL?
No. CICS leaves the symbolic map as it was, so check the response before you use any field in it.
Does HANDLE AID override HANDLE CONDITION MAPFAIL?
Yes. If a HANDLE AID is active for the key pressed, control goes to the AID's label. Check EIBRESP there too, or switch to RESP checking.