DB2 Abends Reference: X'04E', X'04F', and Reason Codes

When DB2 for z/OS hits an internal error it cannot handle politely, it does not only set SQLCODE—it can abend a task with completion code X'04E' or take down the subsystem with X'04F'. This reference explains those completion codes, how reason codes work (including the 00C0xx / 04E00Cxx style fragments you see in dumps), and how subsystem, utility, DSN, IRLM, DDF, and stored-procedure failures differ.

Abends reference
Progress0 of 0 lessons

X'04E' versus X'04F'

Db2 system abend completion codes
Completion codeMeaningScope
X'04E'Internal error; abend one task (Db2 or user-connected)Task
X'04F'Severe error; abend entire Db2 subsystemSubsystem

IBM: errors associated with 04E might be preceded by an MVS system code or other internal errors. The diagnostic material from the 04E must be examined to find the source that led to task (or later subsystem) termination. 04F means Db2 decided continued operation could risk data integrity—the whole subsystem goes away. 04F is often preceded by MVS errors or one or more 04E abends.

What to collect from every Db2 abend

  • System completion code (04E or 04F)
  • Db2 abend reason code (four-byte 00……)
  • SVC dump title / symptom string
  • Preceding DSN* messages on the console or job log
  • SYS1.LOGREC / VRA entries when available
  • For 04F: subsystem termination reason and any prior 04E codes
  • Registers / SDWA pointers as directed by the reason-code topic in Codes
text
1
2
3
4
5
6
7
8
9
Triage card ----------- COMPLETION: S04E (or S04F) REASON: 00E5xxxx ← look up in Db2 Codes DUMP TITLE: ... MESSAGES: DSNxxxxx before the abend Db2 UP?: YES/NO (DISPLAY GROUP / SDSF DA) SQLCODE?: (if application still got one) NEXT: IBM Docs reason code → operator/programmer response

Reason codes: the real diagnostic key

Completion code 04E only says “Db2 abended a task.” The reason code says which subcomponent and which specific check failed. Format:

text
1
2
3
4
5
00 E5 0041 | | | | | +-- numeric id within subcomponent | +----- hex ID of subcomponent (E5 = agent services manager example) +-------- high-order byte always 00 for Db2 reason codes

Hex ids align with message subcomponents (utilities E4, DDF D3, log D1, recovery D9, agent services E5, and so on). Always look up the full reason code for your Db2 version—do not stop at “it was a 04E.”

04E00Cxx and related shorthand

Automation, dump titles, and older runbooks sometimes paste fragments like 04E00C01, 04E00C02, … 04E00C05, or speak of an 04E00Cxx family. Treat these as clues, not as replacements for the official four-byte reason code in Codes:

  • Expand the dump / message to the full 00C0… or other documented reason
  • Look up that reason’s explanation, system action, and operator response
  • Note whether the failure was in a user task, system agent, utility, or DIST
  • Check for companion SQLCODE or DSNU/DSNL messages in the same second

If your shop’s error database maps 04E00C01–04E00C05 to local procedures, keep those runbooks—but verify against current IBM Docs after each upgrade. Reason-code text changes across releases.

Failure areas

Where Db2-related abends show up
AreaWhat to think about
Subsystem abends04F, MSTR/DBM1/DIST/IRLM symptoms, restart recovery
Utility abendsDSNU* then dump; pending states; RESTART/RECOVER
DSN / attachmentTSO/batch attach failures around DSN command processor
IRLM abendsLock manager address space; impacts all Db2 locking
DDF failuresDIST address space / DSNL*; remote apps see SQL errors
Stored proceduresWLM SPAS; SQLCODE vs enclave abend

Db2 subsystem abends

MSTR, DBM1, DIST, IRLM, WLM-SPAS—know which address space dumped. A DBM1 04E might kill work tied to that agent while the subsystem stays up; a 04F ends the subsystem and drives restart/recovery. After 04F, follow your shop’s Db2 restart checklist (active log, BSDS, retained locks in data sharing).

Utility abends

Utilities can fail “soft” with DSNU messages and RC 8, or abend the utility task. On abend: save SYSPRINT, SYSUDUMP/SYSMDUMP, and the reason code. Check whether objects were left in RECOVER PENDING, REORG PENDING, or other restrictive states before rerunning. Prefer IBM RESTART guidance over blind SORTKEYS guesses.

DSN abends

Batch jobs that run under the DSN command processor (IKJEFT01) can abend in the application, in attachment, or in Db2. Distinguish COBOL user abends (S0C7, S0C4) from Db2 04E. User program bugs are not “Db2 abends” even if the job step includes DSN.

IRLM abends

IRLM failures hurt locking for the whole Db2 (and data sharing group partners depending on configuration). Symptoms include widespread timeouts (-911/-913), inability to allocate locks, and IRLM address-space dumps. Coordinate with sysprogs—do not “fix” IRLM by recycling Db2 alone unless the runbook says so.

DDF failures

DIST abends or DDF network failures appear as DSNL messages and remote SQL errors. Clients may see driver exceptions without a local 04E in the CICS region. Correlate timestamps across DIST, TCP/IP, and the requester.

Stored procedure failures

SQL PL procedures usually return SQLCODEs. External procedures can abend in WLM established address spaces. Capture WLM ABEND counts, SPAS dumps, and the caller’s SQLCA. A procedure abend is not always a Db2 engine 04E—but it can be.

Abends versus SQLCODE

Most application mistakes are negative SQLCODEs with no abend. Abends mean control blocks, latching, media, or internal invariants failed. Do not open a “SQLCODE -803” style fix for an S04E—different playbook. Conversely, do not order a dump analysis for a clean -530 foreign key error.

Explain It Like I'm Five

04E is the fire alarm in one classroom—that class evacuates; the rest of the school might still have lessons. 04F is the alarm that empties the whole school because staying would be unsafe. The reason code is the note that says whether it was smoke in the kitchen, a broken pipe, or a lab accident. Always read the note—not just “there was an alarm.”

Exercises

  1. From IBM Docs, quote the difference between X'04E' and X'04F' in one sentence each.
  2. Decode a sample reason code 00E50041 into high byte, hex id, and numeric id. Which subcomponent is E5?
  3. Build an abend triage card template for your team (completion, reason, dump title, messages, Db2 up?).
  4. Find one utility SYSPRINT failure that did not abend and one historical dump that did. Compare artifacts.
  5. List which address spaces you would DISPLAY or check in SDSF after a suspected DDF versus IRLM failure.

Quiz

Test Your Knowledge

1. X'04E' means:

  • Successful SQLCODE 0
  • Db2 detected an internal error and abended a Db2 internal task or a user-connected task
  • Only IRLM is down
  • Always the entire subsystem is gone

2. X'04F' means:

  • A warning SQLCODE
  • Db2 detected a severe error and abended the entire Db2 subsystem because continued operation might risk data integrity
  • Only one utility failed
  • Always ignore it

3. A Db2 abend reason code is typically:

  • A two-digit SQLCODE
  • Four bytes: 00 + hex subcomponent id + numeric id (for example 00E5xxxx)
  • Only the job return code
  • Always 0C4

4. Utility abends vs SQLCODE:

  • Utilities never abend
  • A utility can end with DSNU messages and a non-zero RC, or escalate to a task abend—do not assume every failure is an SQLCODE in your COBOL program
  • Utilities only return +100
  • Utilities only use CICS abends

5. First triage step after an application 04E:

  • Reboot the CEC immediately
  • Capture completion code, reason code, dump title, preceding DSN messages, and whether Db2 itself stayed up
  • Drop all tablespaces
  • Ignore if SQLCODE was 0 earlier