MODULE 12 · JCL AND BATCH JOBS · 8/9

Reading a job log and common abends

18 min30 XPExercise

When a job fails, you don't get a stack trace pop-up. You get a job log and, perhaps, a few lines of messages. Reading it calmly, top to bottom, is one of the most valuable skills you can bring to a mainframe team.

How to read it

  1. Go to the end first. $HASP395 ... ENDED - MAXCC=0000 is good news. ABENDED, or a high MAXCC, means work to do.
  2. Find the first step that didn't end with COND CODE 0000. Later failures are often knock-on effects.
  3. Read the messages just above that step's result, then the step's own output (SYSOUT, and in this course CEEMSG for runtime messages).

Three kinds of failure

JCL errors stop a job before a program runs. Syntax errors are found at conversion. Allocation problems are found just before the step:

  IEF212I PAYNIGHT CALC DATA SET NOT FOUND - TIMEIN DSN=PAYROLL.TIMESHEET

The fix is always in the JCL: a misspelled DSN, OLD/SHR on a dataset that no longer exists, or NEW on one that still exists (DUPLICATE NAME).

System abends (S + three hex digits) come from z/OS:

Code Meaning Usual cause
S806 Module not found PGM= misspelled, or not in STEPLIB
S0C7 Data exception Non-numeric data in a numeric field used in arithmetic
S0C4 Protection exception Subscript out of range, bad CALL parameters
S322 CPU time exceeded A loop that never ends
SB37, SD37, SE37 Out of space Output bigger than its SPACE allowed
S913 Not authorised No RACF access to a dataset

User abends (U + decimal) are issued by software. The one COBOL developers meet most is U4038: Language Environment, the runtime under IBM COBOL, hit a severe error it wasn't told to handle and ended the step. The real explanation is in the runtime messages, for example an IGZ0035S "unsuccessful OPEN" with the file status. In this course's simulator the GnuCOBOL runtime message appears as CEEMSG:

libcob: error: file does not exist (status = 35) for file RATE-FILE ('RATES')

Status 35 on an OPEN INPUT almost always means the step has no DD statement for that DD name.

An abend and the job log

  IEF237I TIMEIN   ALLOCATED TO PAYROLL.TIMESHEETS
  IEF237I PAYOUT   ALLOCATED TO PAYROLL.GROSS.PAY
  CSV003I REQUESTED MODULE PAYCLAC NOT FOUND
  IEF285I   PAYROLL.TIMESHEETS             KEPT
  IEF285I   PAYROLL.GROSS.PAY              DELETED
  IEF450I PAYNIGHT CALC - ABEND=S806
  IEF202I PAYNIGHT PRINT - STEP WAS NOT RUN BECAUSE OF CONDITION CODES

Three things to notice. The datasets were allocated, so the JCL was fine. PAYROLL.GROSS.PAY was deleted because the step abended and its DD said DISP=(NEW,CATLG,DELETE): the rerun can create it again. And PRINT was flushed because an earlier step abended.

Not simulated

GnuCOBOL doesn't trap bad numeric data or out-of-range subscripts the way z/OS does, so you won't see S0C7 or S0C4 here. You will see them at work. For an S0C7, the dump or the CEEDUMP output gives the offset of the failing instruction; the compile listing maps it to a COBOL statement, and the record being processed is usually the culprit.

On the job

Before you change anything, write down the abend code, the failing step, and the key message. Then decide: is this a JCL problem (fix the JCL, rerun), a data problem (fix or remove the bad record, rerun), or a program problem (fix, test, promote)? Restarting a failed job from the failing step, with RESTART= on the JOB card, is routine, but only once you know the earlier steps' outputs are good.

Your task

You're on call. The payroll job failed overnight and the operator has sent you the job log:

 JES2 JOB LOG -- PAYNIGHT

  IEF212I PAYNIGHT CALC DATA SET NOT FOUND - TIMEIN DSN=PAYROLL.TIMESHEET

  $HASP395 PAYNIGHT ABENDED

Fix the job. You'll find there is more than one problem: each fix lets the job get a little further, so run it after every change and read the new job log.

What you know about the job:

  • Step CALC runs the payroll program PAYCALC. It reads the hourly rate for each grade from DD RATES, then this week's timesheets from DD TIMEIN, and writes gross pay to DD PAYOUT.
  • The cataloged datasets are PAYROLL.RATES and PAYROLL.TIMESHEETS. Both are read-only reference data for this job.
  • Step PRINT prints the gross pay file. Leave it as it is.

Check your understanding

1. A step ends ABEND=S806. What is the most likely cause?
2. A step that normally takes two minutes ran for an hour and ended ABEND=S322. What should you suspect first?
3. The job log says DATA SET NOT FOUND. Which steps ran?
4. What's the difference between an S (system) and a U (user) abend code?
JCL
Run your program to see its output here. The first visible test's input and datasets are used.
Submit to grade your program against every test.