System abend

S04E: Db2 abend with a reason code

S04E is an abend completion code that Db2 for z/OS issues when it detects an error and ends the task that was doing the work. The 8-digit hex Db2 reason code that comes with it, such as 00Cxxxxx or 00Exxxxx, identifies the actual problem.

Other names for this code

Also written as 04E, abend 04E, ABEND04E, S04E abend, DB2 04E, Db2 abend 04E, 04E reason code.

What it means

Most system completion codes come from z/OS or the hardware. X'04E' and X'04F' belong to Db2 for z/OS, and IBM documents them in detail in the Db2 for z/OS Codes manual. Db2 uses 04E when one of its components finds an error or a condition it can't handle in line. It abends the task involved, its recovery routines clean up, and the Db2 subsystem itself normally keeps running.

The abend code tells you only that Db2 ended the work. The reason code tells you why. Db2 reason codes are eight hex digits, and the leading digits identify the area of Db2 that raised them. Each one is listed in the Db2 reason codes section of Db2 for z/OS Codes for your version.

An 04E can show up in two places. Inside the Db2 address spaces it usually produces an SVC dump and a SYS1.LOGREC record, plus DSN messages in the Db2 master address space log. In an application address space, such as a batch job using the TSO attach, CAF or RRSAF, the job step itself can end with S04E when Db2 abends the work being done for it. In that case the job log shows ABEND=S04E and the reason code.

Some reason codes point to a Db2 defect. Others point to a problem with data, an index or the environment that you can fix yourself. So read the reason code before deciding who should act.

Common causes

  • An internal Db2 error, which IBM fixes with maintenance. Search IBM support for ABEND04E with the reason code.
  • Db2 found inconsistent data or index pages while processing a request, which needs checking with Db2 utilities.
  • A resource or environment problem that Db2 reports through an abend, such as a shortage in one of its address spaces.
  • A request from an application that put a Db2 component into a state it treats as an error. The reason code description says when the application is responsible.

How to find the problem

  1. Get the full reason code. It appears as REASON= in IEF450I or IEA995I in the failing job's log, and in the dump title of any SVC dump Db2 took.
  2. Look up the reason code in Db2 for z/OS Codes for your Db2 version. The entry explains the condition and whether it points to a defect, to data or to the environment.
  3. Check the Db2 master address space job log (ssidMSTR) and the system log for DSN messages at the same time. They often carry the same reason code and name the database, table space, index or page involved.
  4. Check SYS1.LOGREC for the matching record, and keep the dump. IBM support will ask for both if the reason code points to a Db2 defect.

How to fix it

  • If the reason code names a damaged object, check it with CHECK DATA or CHECK INDEX, and repair it with REBUILD INDEX or RECOVER as the situation requires.
  • If it points to a Db2 defect, search IBM support for ABEND04E and the reason code, apply the PTF, or open a case with the dump, the logrec record and the DSN messages.
  • If it points to an environment problem, such as storage or a resource limit, fix that and rerun.
  • Before rerunning a failed application, check whether it needs restart logic. Db2 normally backs out the uncommitted work of the abended unit of recovery.

IBM documentation

IBM z/OS: 04E. Use the documentation for your installed release.

Report a correction to WND Software.

Questions

Is S04E a bug in my program?

Usually not directly. It is Db2 ending the work, and the Db2 reason code tells you whether the cause is a Db2 defect, a data problem or something the application did.

What is the difference between S04E and S04F?

With S04E, Db2 ends one piece of work and normally keeps running. S04F means the whole Db2 subsystem ended abnormally.

Where are Db2 reason codes documented?

In the Db2 reason codes section of Db2 for z/OS Codes for your Db2 version. The same manual has an appendix on the 04E and 04F abend completion codes.