What it means
Abend 002 is raised by data management (DFSMSdfp) when processing a sequential data set with QSAM or BSAM goes wrong, or while a direct organisation data set is being created. Message IEC036I comes with it and gives the return code, the DD name and the data set.
Before ending the task the system takes the program's DCB ABEND exit if it has one. The fix depends on the return code, so always read IEC036I first. A well-known case is 002-18, where a record is longer than the record length the data set was set up with.
Typical causes
- A program writes a record longer than the data set's record length (002-18).
- An output data set allocated with attributes that do not fit the records being written.
- An input file in a different layout from the one the program expects.
- A program or record definition changed without the data set being reallocated.
How to fix it
- Read the IEC036I return code, DD name and data set name.
- Compare the program's record length with the LRECL, RECFM and BLKSIZE of the data set.
- Reallocate the output data set with attributes that fit the records, or fix the program.
- Check the input really is in the layout the program expects.
- If the error repeats and the program is not at fault, collect a GTF trace with DCB=DIAGNS=TRACE for the system programmer.
Example
Illustrative only; names and values are invented.
IEF450I EXTRJOB1 STEP040 - ABEND=S002 U0000 REASON=00000018