JCL Production Support - ABENDS
JCL Production Support - ABENDS
JCL Production Support - ABENDS
The System Completion Code (and often a short text description of what it designates)
The COBOL instruction (statement) or line number, which contained the invalid operation causing
Z/OS to halt execution
A "core-dump" (a hexadecimal printout) of the internal machine storage and registers relevant to the
areas of your program surrounding the COBOL instruction which caused Z/OS to halt execution.
This information is useful to begin understanding and researching the problem, but it is usually far from sufficient to
solve the problem, which could be any combination of:
etc.
There are as many different ways to analyze and research COBOL ABENDs as there are individual approaches to
writing procedural logic. However, if you've never done this type of "logic-detective" work on a large scale, and to
help you get started with this complex and crucial process, consider the following approach of five steps:
Preparation
Research
Hypothesis
Solution
Resolution
As a final note before beginning, understand that there are really two distinct phases of Production Support:
1. Data Center on-call ABEND resolution - wherein a technician receives notification that a job or
transaction has ABENDd and must be "fixed" within an extremely short timeframe (usually minutes to
hours). In this case, the technician's main concern is to "patch" the problem - get the system back online, or
get the batch jobstream back into production ("Patch-It").
2. NextDay problem resolution - wherein technician(s) actually track down and solve the problem that
caused the ABEND ("Fix-It").
The steps below represent a process for "FixIt" - they go well beyond the scope of the emergency measures used to
"patch" the problem during an OnCall emergency.
1.
2.
Collect all supporting ABEND output (SYSOUT) from the job - (ABEND-AID, DISPLAY
statements, etc.)
Obtain copies of the run-time:
JCL
To make the correct WHY determination usually requires a combination of "Static" and "Dynamic"
analysis - complementary research and investigative approaches. Note: These steps need not be
followed in this order. Rather, in time you will develop an "intuition" as to which kind(s) of analysis
will be most likely to provide the information you need to solve your problem. In a production support
role
Static Analysis:
1. Structural Visualization: is the generation of an accurate mental map, understanding
or mental image of the program's control structure, or logic-architecture. Using the
starting point represented by the ABEND condition (the statement which caused Z/OS to
halt execution) and using electronic-assisted tools (such as IBMs Rational Asset
Analyzer or Rational Developer for System z), build an accurate understanding of the
code invocation at:
(if necessary i.e. if the code is dense or complex) Statement level (Flow chart)
Structural Visualization can done be "top-down", by asking open-ended questions; such
as learning how a particular routine "hangs-together logically", or it can be used "bottomup", by asking specific close-ended questions about a program, such as "How does this
particular paragraph get executed?" "How did this module get invoked?"
2. Data Flow Analysis: A combination of control structure analysis and data item
analysis, which seeks to determine the usage of particular fields throughout a
program. Data flow analysis is used to determine (from a given instance of a data item)
where the next occurrence(s) of that item exist in your program, and how the data item is
used; (as a receiving field in a MOVE or mathematical operation, as the sending field in
a MOVEstatement, as part of a logic-branch (IF, PERFORM UNTIL/VARYING, etc.).
3. Data Impact Analysis: An expansion of Data Flow Analysis which traces the
movement of data from field-to-field throughout a program, or throughout an entire
application; including I/O (screens and files). Using Data Impact Analysis, you can
identify all fields that might have had an impact on the contents of a field (before the
ABEND occurred). And just as importantly - you can learn the affect changing this field
will have on the behavior of the application.
4. Textual or Data Item Usage: Utilized more for application maintenance and
enhancement requests, this type of Static Analysis involves searching for "categories"
of program-items, such as "List all fields that contain *JUL*, *GREG*, *YR*, *YEAR*
(suspect date candidates for Year2000 conversion), or list all such fields with two digits
(numeric) or two-byte (alphanumeric) definitions.
Dynamic Analysis:
1. Tracing: Source-level interactive debugging. Watch the program execute statement-bystatement, and line-by-line. This is very useful for detailed-debugging, particularly of
dense or complex instructions. Some software (for example, the Rational Developer for
System z) allows you to trace the program logic, attempting to re-create the sequence of
events (COBOL statements) that transpired up to and including the ABEND
condition. Tracing is an invaluable method for detailed debugging. However, given the
size and scope of production applications, it is generally more practical to Trace specific
problem areas of a program.
3. Selective Data State Collection: Execute code and establish a functional summary
of specific data states that it creates. Use these states in subsequent test runs to compare
results of current values to expected values.
4. Coverage: Analyze the number of times each COBOL statement is executed for a given
run. This technique is extremely useful for analyzing test data coverage of a given
application. And it can be used effectively for debugging if it makes apparent problems
such as infinite loops (S222, S322 and B37 ABENDs), over-loading tables - (loading
tables beyond the maximum OCCURS clause and overlaying storage, which can cause
S0C1, S0C4, and S0C7 ABENDs).
3.
Using a COBOL research and analysis tool (such as IBMs Rational Asset Analyzer or Rational
Developer for System z), or some other source-level analysis software) perform Static and/or Dynamic
Analysis on the specific areas of the application relating to the ABEND, to determine (based
on WHERE the problem manifested itself to the system - obtained from the ABEND-AID listing of
which statement caused the ABEND ) HOW this particular problem occurred in the application.
4.
With the research in steps 1 and 2, you should be able to describe WHAT, WHERE and HOW the
ABEND occurred (at what point in the program the logic failed, and what sequence of COBOL
statements caused the failure).
However, before modifying any logic, you must determine WHY these statements (or sequence of
events) caused this particular failure (e.g. "Why did this production input file contain spaces in a
numeric field?" "Why did the program's logic perform the Initialization routine twice?" "Why did the
Read routine execute past end-of-file?", etc.).
Only through a determination of WHY will you be able to make a change to production business logic
safely, and with confidence that;
Your familiarity with the program's business purpose - coupled with your ability to grasp the
point of each statement (assuming you didn't write the code)
Type of ABEND and reason for the problem (some are more diabolical than others)
Take the appropriate action to resolve any business - or system-wide issues. Depending on how
extensive the damage caused by the problem, or for how long any problems have persisted undetected:
Jobs may have to be re-run from a previous point-in-time (synchronized with file
generations)
Files may have to be modified with "one-shot" programs, written to resolve issues that
require "surgery" on the data
Take the appropriate action to fix the technical (coding) problem
5.
Create an "image copy" of the production file system, in order to test your fix
Run "Regression Tests" against the new code - analyze for unexpected results
S0C1
Table-handling overlay (MOVEs to table subscripts/indexes which are out-of-range - and which
overwrite PROCEDURE DIVISION instructions)
The COBOL compiler always generates valid machine instructions. S0C1's usually occur when populating
tables beyond the valid OCCURS range
S0C4
Table-handling overlay errors (MOVEs to table subscripts/indexes which are out-of-range - and which
overwrite PROCEDURE DIVISION instructions)
STOP RUN or GOBACK in the INPUT or OUTPUT PROCEDURE when using the
COBOL SORT verb
Unless your program is executing with "bounds-checking" (supported by CA-Capex Optimizing, COBOL II
and COBOL/370 - and generally not used in production), your table routines could overlay the contents of
storage beyond the boundary of the OCCURS clause. This can cause S0C7s (see above) S0C1s and S0C4s by
overwriting field values in the Data Division (S0C7s) or actually overwriting the instructions in
your PROCEDURE DIVISION, producing invalid addresses (operands) for the executable (machine) code
(which in turn can cause S0C1s and S0C4s)
Explanation
Verify that all table-handling subscript/index
references are within the allowable range of
of the table's OCCURS clause
(>= 1, <= OCCURS max).
S0C7
Data exception (invalid numeric data in numeric field - caught by a Convert-to-Binary machine instruction
during a mathematical operation or numeric compare)
Arithmetic instructions:
Comparisons involving tests of numeric fields (which can occur with the following statements):
MOVE statements when the receiving field is packed (COMP-3) or binary (COMP) and the sending
field contains invalid numeric data
S0C7s occur when Z/OS finds invalid numeric data in a field defined as PIC 9 (all PIC 9 fields - DISPLAY,
COMP, COMP-3 and floating point) during arithmetic or compare operations
Explanation
Be sure all numeric work areas contain
a VALUE clause at the elementary level
or are correctly INITIALIZEd before they
are used (as other than receiving fields in MOVE
statements) within your program. Be particularly
careful with "counters and accumulators". Also,
always initialize elementary (rather than group)
COMP-3 fields.
May need "IF NUMERIC " test - or may
need to browse output files produced in
previous job step ("input" to this program)
generates an
adjacent
to the storage area set aside for the table through its
OCCURS clause)
Referencing incorrectly defined/passed
LINKAGE SECTION fields
S0CB
DIVIDE statements if the quotient in a division using a decimal operand is greater than the size of the
receiving field
Division by zero
Note that S0CB ABENDs may be intercepted by COBOL library subroutines (which automatically check for
zero before dividing). If this is the case zero-divide will result in "user" return-codes:
U1061 - VS COBOL II
Explanation
Program logic should always check to see if the
divisor has been properly initialized or updated.
Or in the case of input edits and data validation,
that the divisor is > zero before doing the division.
Also check to see whether a fractional value was
MOVEd to an integer field, truncating the fractional
value and resulting in zero divide.
S001
Input/Output problem
S001 errors occur primarily due to incorrect COBOL logic (fall-thru errors, logic executed out of sequence,
etc.)
Explanation
Occurs if your program READs before opening a
or READs after closing a file (Place file OPEN/CLOSE
statements in dedicated Initialization and Termination
paragraphs.)
UNTIL.)
S013
S013s occur due to inconsistencies between COBOL file description statements in your program, and:
The DCB (data control block) parameter specified on the file DD statement in your JCL (for output
files) or
The DCB entry taken from the physical file DCB parameters, stored on the file's device header.
Explanation
Occurs if your program's RECORD
CONTAINS clause conflicts with the
physical file's record length. Or if your
program's BLOCK CONTAINS clause
conflicts with the physical file's blocking
factor. Suggestion - on input files, do not
specify RECORD CONTAINS. Code
BLOCK CONTAINS 0 RECORDS.
S213
S213s occur when an input file is not found. This can happen if:
Explanation
Occurs on file OPEN when the system
cannot find the input filename as specified
in your JCL. This can happen because of
a simple typo in the JCL, or because a
previous job failed to complete successfully.
S122/222/322
Operator cancel
S122 means the job was canceled and a storage dump was requested
S222 means the job was canceled, but a dump was not requested (although, depending on which Z/OS
routine was active when the job was canceled a dump may have been produced)
S322s occur when Z/OS cancels a job because the default or specified CPU time limit for a job step or
procedure was exceeded
(Note on S122/222) It is important to note that S122/222 job cancellations are "judgment calls" by the system
operator, and that in fact, there may be nothing wrong at all. Always begin your research by calling the operator
and requesting an explanation of why they canceled the job.
(Note on S322) If a job that normally processes 100,000 records jumps to 10,000,000, or if it is run on a slower
CPU with slower external devices S322 may simply signify that you have to increase the CPU time in the JCL
However, it could be that S122/222/322s occur because of program logic or job execution errors:
S806
S806s occur when a called program (or system subroutine) is not found. This can happen if:
Explanation
If your program makes a dynamic CALL and the
module-name being called is not found, you can get
S806, S0C4 or S0C1 system errors. The reasons for
invalid module-names include; misspelling the name,
incorrectly specifying the STEPLIB/JOBLIB DSN= in the
JCL (or incorrectly concatenating
the STEPLIB/JOBLIB datasets), leaving out apostrophes (or
quotes) on a CALL literal - which would cause the COBOL
compiler to treat the statement as if it were a CALL identifier
- and if an identifier with that name exists in the Data
Division, COBOL will attempt a dynamic CALLto the value of
the identifier.
B37/E37
B37/E37s occur when there is insufficient space on an output device. This can occur because of:
Insufficient SPACE allocated through the JCL for an output file - in which case you should reestimate the SPACE requirements for your output file, and increase SPACE allocation
Insufficient SPACE on a particular DASD device - in which case you should either choose a different
device, or remove some files from the pack.
A program logic error such as an infinite loop which includes WRITE statements
Explanation
Occurs when a file your logic repeatedly executes
a WRITE statement over and over. Generally due to
incorrectly setting or checking switches and return-codes,
or some type of fall-through error.