MainframeKit

AEY9

CICS-Db2 attachment not availableCICS ABEND

The program issued an SQL call but CICS could not pass it to Db2, typically because the CICS-Db2 attachment is not active.

MOST LIKELY

The CICS-Db2 attachment was never started or was stopped.

FIRST CHECK

Check that Db2 is active and that the CICS-Db2 connection is connected (for example with CEMT INQUIRE DB2CONN).

TRY IT ▸

MainframeKit assistant

What it means

When a program runs EXEC SQL, CICS sends the request through the CICS-Db2 attachment facility. If the attachment is not enabled, or is waiting for Db2 and the connection is set to abend on error, the task ends with AEY9.

If the DB2CONN is set to return an SQL code instead of abending, the program sees SQLCODE -923 rather than AEY9. IBM also describes a case where a Db2 security rejection (SQLCODE -922) surfaced as AEY9.

Typical causes

  • The CICS-Db2 attachment was never started or was stopped.
  • Db2 is not up yet and the attachment is still waiting for it, with CONNECTERROR=ABEND in DB2CONN.
  • The region's security setup does not allow it to connect to Db2 (seen with SQLCODE -922).
  • Someone shut the connection down manually while transactions were still running.

How to fix it

  1. Check that Db2 is active and that the CICS-Db2 connection is connected (for example with CEMT INQUIRE DB2CONN).
  2. Set STANDBYMODE=RECONNECT in DB2CONN so CICS reconnects by itself when Db2 comes back.
  3. Consider CONNECTERROR=SQLCODE so programs get -923 and can handle it instead of abending.
  4. Make sure the connection starts with the region (DB2CONN=YES in the SIT or the PLT start-up program).
  5. If you see -922, review the CICS and Db2 security definitions for the region.

Example

Illustrative only; names and values are invented.

DFHAC2236 07:58:12 APPL01 Transaction TRN1 abend AEY9 in program PROG01 term T001. Updates to local recoverable resources will be backed out.