What it means
CICS programs reach Db2 through the CICS Db2 attachment facility, which is controlled by the DB2CONN resource in the region. When a program issues EXEC SQL and the attachment can't take the request, the task can end with AEY9.
Whether you get AEY9 or an SQL code depends on the state of the attachment. If it was started but isn't connected to Db2 right now, the DB2CONN attribute CONNECTERROR decides. With CONNECTERROR(ABEND), the program gets AEY9. With CONNECTERROR(SQLCODE), the SQL call returns SQLCODE -923 and the program can handle it. If the attachment was never started, or someone stopped it, the program gets AEY9 whatever CONNECTERROR says.
AEY9 is not a program bug in most cases. The application code usually ran fine yesterday. Something in the connection between CICS and Db2 changed.
Common causes
- Db2 is down or restarting, or the region lost its connection to it, and the DB2CONN specifies CONNECTERROR(ABEND).
- The attachment was never started. The region came up without DB2CONN=YES in its system initialization parameters and nothing else started it.
- Someone stopped the attachment with
DSNC STOPorCEMT SET DB2CONN NOTCONNECTED, often for Db2 maintenance, while transactions were still arriving. - No DB2CONN is installed in this region at all. This happens with a new region, or when a transaction is routed to a region that was never set up for Db2.
How to find the problem
- Run
CEMT INQUIRE DB2CONN. It shows whether the attachment is connected and what CONNECTERROR and STANDBYMODE are set to. - Look in the CICS region's log for DFHDB2 messages about the attachment starting, stopping, or losing Db2 around the time of the abends.
- Ask the Db2 team, or check the system log, whether the Db2 subsystem was up at that time.
- If only some regions get AEY9, compare their DB2CONN definitions and their DB2CONN system initialization parameter. A region that differs from the others is usually the answer.
How to fix it
- Start the connection with
CEMT SET DB2CONN CONNECTEDorDSNC STRTonce Db2 is available. - Set DB2CONN=YES in the region's system initialization parameters so the attachment starts with CICS. Some sites start it from the program list table at startup (PLTPI) instead.
- Use STANDBYMODE(RECONNECT) on the DB2CONN. The attachment then waits in standby while Db2 is down and reconnects by itself when Db2 comes back.
- If your programs handle SQLCODE -923 properly, CONNECTERROR(SQLCODE) lets them show a 'database unavailable' message instead of abending.
- Avoid stopping the attachment while work is still flowing. Stop or drain the Db2 transactions first.
- AEY9 is fixed by the CICS systems programmers together with the Db2 team. The application team only gets involved when programs need to handle -923.
What it looks like
DFHDU0203I 10/12/2026 06:12:40 CICSPRD3 A transaction dump was taken for dumpcode: AEY9, Dumpid: 1/0102. DFHAC2206 06:12:40 CICSPRD3 Transaction PAY5 failed with abend AEY9. Updates to local recoverable resources backed out.