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.
| Completion code | Meaning | Scope |
|---|---|---|
| X'04E' | Internal error; abend one task (Db2 or user-connected) | Task |
| X'04F' | Severe error; abend entire Db2 subsystem | Subsystem |
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.
123456789Triage 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
Completion code 04E only says “Db2 abended a task.” The reason code says which subcomponent and which specific check failed. Format:
1234500 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.”
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:
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.
| Area | What to think about |
|---|---|
| Subsystem abends | 04F, MSTR/DBM1/DIST/IRLM symptoms, restart recovery |
| Utility abends | DSNU* then dump; pending states; RESTART/RECOVER |
| DSN / attachment | TSO/batch attach failures around DSN command processor |
| IRLM abends | Lock manager address space; impacts all Db2 locking |
| DDF failures | DIST address space / DSNL*; remote apps see SQL errors |
| Stored procedures | WLM SPAS; SQLCODE vs enclave abend |
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).
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.
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 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.
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.
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.
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.
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.”
1. X'04E' means:
2. X'04F' means:
3. A Db2 abend reason code is typically:
4. Utility abends vs SQLCODE:
5. First triage step after an application 04E: