User abend

U4039: Language Environment abend to take a dump

A U4039 abend means Language Environment hit a severe error that nothing handled, and issued abend 4039 to take a system dump because the TERMTHDACT runtime option asked for one. The real error is in the CEE or IGZ message written just before it.

Other names for this code

Also written as U4039, abend U4039, user abend 4039, 4039 abend, S000 U4039, LE abend 4039, ABEND=S000 U4039, abend 4039 TERMTHDACT.

What it means

This page covers user abend 4039 as issued by z/OS Language Environment (LE), the runtime used by COBOL, PL/I and C programs. User abend numbers belong to whoever issues them, so another product could use 4039 for something else. If the messages before the abend start with CEE, IGZ, IBM or EDC, it is the LE code.

When an error of severity 2 or higher goes unhandled, LE ends the thread. The TERMTHDACT runtime option decides what LE writes on the way out. With the settings UAONLY, UATRACE or UADUMP, LE issues user abend 4039 so that z/OS writes a system dump of the address space. UAONLY gives only that dump. UATRACE adds a traceback in the CEEDUMP, and UADUMP adds the full CEEDUMP.

So U4039 says nothing about the error itself. It is the same situation as U4038, with a dump requested. The dump is taken during condition handling, before LE cleans up, which makes it the most useful dump of the failure. What the step shows at the very end can vary with the error and the ABTERMENC option. IEF450I may show U4039, or the original code such as S0C4 if LE reissues it at the end of termination.

Common causes

  • The job, the program or the system default runs with TERMTHDACT(UAONLY), UATRACE or UADUMP. Sites often set this on purpose so every severe error leaves a system dump. The value can come from the CEEPRMxx parmlib member, a CEEUOPT or CEEROPT module linked with the program, a CEEOPTS DD, or the PARM.
  • Under that setting, a program check such as a data exception or a protection exception. LE reports these as CEE3207S (S0C7) or CEE3204S (S0C4).
  • A COBOL runtime error with no handler, such as IGZ0035S for a failed OPEN or IGZ0006S for a subscript out of range.
  • A severe error in PL/I or C code, reported by messages that start with IBM or EDC.

How to find the problem

  1. Read the LE messages just before the abend. They go to the MSGFILE, which is SYSOUT unless your site changed it. The first message ending in S, E or C is usually the error. A CEE32xxS message gives the system completion code and the offset in the failing program.
  2. If TERMTHDACT was UATRACE or UADUMP, open the CEEDUMP. Its traceback lists the active routines in calling order, with the statement or offset each one had reached.
  3. Find the system dump. It goes to whichever of SYSMDUMP, SYSUDUMP or SYSABEND the step allocates. A SYSMDUMP can be read with IPCS, and the IPCS command VERBEXIT LEDATA formats the LE control blocks.
  4. To see which TERMTHDACT value was in effect and where it came from, rerun with RPTOPTS(ON). LE then prints a report of every runtime option and its source.

How to fix it

  • Fix the error the message names. U4039 goes away with it, because there is nothing left for LE to dump.
  • If you don't want a system dump for every severe error, change TERMTHDACT to TRACE or DUMP for that job, for example through a CEEOPTS DD. Agree this with whoever set the default, because they probably wanted those dumps.
  • Make sure the dump DD points somewhere with enough space or a held SYSOUT class. A dump that is lost or truncated wastes the reason the abend was taken.
  • The application team fixes the underlying error. The systems programmers own the site-wide TERMTHDACT setting in CEEPRMxx.

IBM documentation

IBM Language Environment documentation. Use the documentation for your installed release.

This link opens the relevant IBM reference library or lookup instructions. Match the complete code and your installed product release; it is not a code-specific review.

Report a correction to WND Software.

Questions

Is U4039 worse than U4038?

No. Both mean LE ended the program for an unhandled severe error. U4039 just means TERMTHDACT asked LE to take a system dump as well.

Why did I get U4039 but no CEEDUMP?

With TERMTHDACT(UAONLY), LE writes the system dump and no CEEDUMP. Use UATRACE or UADUMP if you want both.

Can I stop U4039 from happening?

You can stop the dump by changing TERMTHDACT. The same error then ends without a system dump, with U4038, the original abend code or a return code, depending on the ABTERMENC option. The error itself still needs fixing.