System abend

S04F: Db2 subsystem abnormal termination

S04F is the abend completion code Db2 for z/OS uses when the Db2 subsystem itself ends abnormally. Message DSNV086E gives the termination reason code, and an earlier 04E abend or DSN message usually shows what started the failure.

Other names for this code

Also written as 04F, abend 04F, ABEND04F, S04F abend, DB2 04F, Db2 abend 04F, DSNV086E.

What it means

Db2 for z/OS uses two abend completion codes of its own, documented in the Db2 Codes manual. X'04E' ends a single piece of work. X'04F' means Db2 has decided it can't continue safely and is ending the whole subsystem. Db2 does this when an error hits a part of the subsystem it can't run without, or when carrying on could damage data. The Db2 address spaces end with 04F.

Db2 issues message DSNV086E with a reason code for the termination. That reason code is a Db2 reason code, documented in the Db2 reason codes section of Db2 for z/OS Codes. It often describes the termination itself, so the first error that led to it matters more. Look back in the system log for an earlier 04E abend or DSN error message.

While Db2 is down, applications can't use it. Batch jobs connected through TSO attach, CAF or RRSAF lose their connection. CICS transactions that need Db2 fail until the CICS-Db2 connection is back, with AEY9 or SQLCODE -923 depending on how the connection is defined. When Db2 is started again, restart processing reads the log. It completes committed work, backs out uncommitted work, and leaves indoubt units of recovery until their coordinator resolves them.

Common causes

  • An error in a critical Db2 component, often reported first as an 04E abend, that Db2 treated as fatal.
  • Loss of a resource Db2 depends on, such as its lock manager (IRLM) or its log data sets.
  • A Db2 defect that IBM fixes with maintenance. Search IBM support for ABEND04F with the reason code.

How to find the problem

  1. Find DSNV086E in the system log or the Db2 master address space job log (ssidMSTR) and note the reason code.
  2. Look up the reason code in Db2 for z/OS Codes for your Db2 version.
  3. Scroll back in the system log to the first error before the termination. Look for an earlier 04E abend, DSN messages from the log manager or other components, and IRLM messages.
  4. Collect the SVC dump, the SYS1.LOGREC records and the system log for the period. IBM support needs them if the cause isn't clear.

How to fix it

  • Fix the condition behind the first error, such as a log data set problem or an IRLM failure, before restarting.
  • Restart Db2 with the START DB2 command and watch the restart messages for problems.
  • After restart, check for indoubt threads with -DISPLAY THREAD(*) TYPE(INDOUBT) and for objects left in a restricted state with -DISPLAY DATABASE(*) SPACENAM(*) RESTRICT.
  • Restart the attachments that need it, such as the CICS-Db2 connection, and rerun failed batch jobs from their restart points.
  • If the reason code points to a Db2 defect, apply the fix or open a case with IBM.

IBM documentation

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

Report a correction to WND Software.

Questions

Is committed data lost when Db2 ends with S04F?

No. Restart processing uses the Db2 log to complete committed work and back out work that wasn't committed. Indoubt work waits until its coordinator resolves it.

What is the difference between S04E and S04F?

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

Why does the DSNV086E reason code not explain the cause?

It often describes the termination itself. The original problem usually appears earlier in the system log, as an 04E abend or another DSN error message.