Showing posts with label IPCS. Show all posts
Showing posts with label IPCS. Show all posts

Saturday, 10 August 2013

JCL ABEND Dumps: SYSUDUMP, SYSABEND, and SYSMDUMP.

A COBOL step ends with S0C7, the job log shows the failing step, and the programmer needs storage, registers, and traceback details before rerunning production input. In JCL, that starts with the dump DD statement coded in the job step.

JCL abnormal termination dump diagram comparing SYSUDUMP SYSABEND and SYSMDUMP DD statements
Pick the dump DD by need.

What is an ABEND dump in JCL?

An ABEND dump is diagnostic output produced when a job step abnormally ends. IBM documents SYSABEND, SYSUDUMP, and SYSMDUMP as special DD statements used in a job step to direct z/OS to produce a dump.

The dump DD statement does not make a step fail. It tells the system where to write dump information if the step fails or starts abnormal termination processing. If the job runs normally, no ABEND dump is produced.

SYSUDUMP vs SYSABEND vs SYSMDUMP

DD name Output type Use it when
SYSUDUMP Formatted dump of user areas. You need a printable dump for ordinary application debugging.
SYSABEND Formatted dump with user and system areas. Support needs more system control block detail than SYSUDUMP gives.
SYSMDUMP Unformatted, machine-readable dump. You plan to analyze the dump with IPCS or send it to support.

Basic SYSUDUMP example

SYSUDUMP is often enough for a simple COBOL program failure. Code it after the EXEC statement for the step where you want the dump.

//STEP010  EXEC PGM=EMP001
//STEPLIB  DD  DSN=PROD.LOADLIB,DISP=SHR
//INFILE   DD  DSN=PROD.EMP.INPUT,DISP=SHR
//OUTFILE  DD  SYSOUT=*
//SYSUDUMP DD  SYSOUT=*

If EMP001 ends with an ABEND, the dump goes to job output. If the step completes with condition code 0, no dump is written.

When to use SYSABEND

SYSABEND gives a formatted dump like SYSUDUMP, but includes extra system areas. IBM notes that SYSABEND contains the areas in SYSUDUMP plus additional system information such as LSQA and IOS control blocks for the failing task when IBM-supplied defaults are used.

//STEP020  EXEC PGM=PAYROLL
//PAYIN    DD  DSN=PROD.PAY.INPUT,DISP=SHR
//PAYOUT   DD  SYSOUT=*
//SYSABEND DD  SYSOUT=*

Use SYSABEND when the failure points beyond normal application data, or when a support team asks for it. For routine program data errors, SYSUDUMP is usually less noisy.

When to use SYSMDUMP

SYSMDUMP is not a printed report. IBM describes it as an unformatted machine-readable dump that should be processed by IPCS. Do not route it to SYSOUT; write it to a data set with enough space.

//STEP030  EXEC PGM=ONLINEB
//SYSMDUMP DD  DSN=PROD.DUMPS.ONLINEB.D&SYSUID,
//             DISP=(NEW,CATLG,DELETE),
//             UNIT=SYSDA,
//             SPACE=(CYL,(200,100),RLSE)

Use SYSMDUMP when the dump must be opened in IPCS, retained for support, or moved to another diagnostic process.

Where to place dump DD statements

Place the dump DD statement inside the job step that may fail, after that step's EXEC statement. If a job has several steps, add the dump DD to the step being tested or to each step where a dump is useful.

//STEP010  EXEC PGM=READCUST
//SYSUDUMP DD  SYSOUT=*
//STEP020  EXEC PGM=UPDCUST
//SYSABEND DD  SYSOUT=*

If more than one of these dump DD names is coded in the same step, the last one in the step controls the requested dump type. Keep one dump DD per step unless you have a site-specific reason.

What to check before reading the dump

Start with the job log. Find the failing step name, program name, ABEND code, condition code, PSW, and register information. The dump is useful only after you know which step failed and what symptom the system reported.

  • Check JESMSGLG, JESJCL, and JESYSMSG for the failing step.
  • Look for system ABEND codes such as S0C7, S0C4, or S222.
  • For user ABENDs, look for application messages written before the failure.
  • Confirm whether the dump DD was present in the same step that failed.

Common mistakes

Putting SYSMDUMP in SYSOUT

SYSMDUMP is meant for IPCS processing. Route it to a dump data set, not a printed output class.

Coding the dump DD in the wrong step

A dump DD under STEP010 will not capture a failure in STEP020. Put the DD in the step you are diagnosing.

Saving huge dumps without a reason

Dumps can consume spool or disk space quickly. Use the smallest dump type that gives the detail needed, and follow your site's retention rules.

Related JCL and debugging topics

For nearby topics, read JCL DD Statement, JCL EXEC Statement, JCL JOB Statement, JCL Conditional Job Processing, JCL Restart, and JCL Utilities.

External references

Technical notes in this refresh were checked against IBM SYSABEND, SYSMDUMP, and SYSUDUMP DD documentation, IBM dump DD examples, IBM reserved DD names, and IBM dump diagnosis procedure.

FAQ

What is SYSUDUMP in JCL?

SYSUDUMP requests a formatted dump of user areas when the job step abnormally ends.

What is the difference between SYSABEND and SYSUDUMP?

SYSABEND includes the areas in SYSUDUMP plus additional system areas when default dump options are used.

Can SYSMDUMP be printed directly?

No. SYSMDUMP is unformatted and machine-readable. It is intended for IPCS analysis.

Does a dump DD create a dump for every job run?

No. A dump is produced only when the step abnormally terminates or enters abnormal termination processing.

New In-feed ads