Abend 002 occurs while the control program is processing a sequential data set with BSAM or QSAM, or creating a direct data set. It comes with message IEC036I, whose return code gives the reason.
Return codes 04 to 18 mostly concern invalid record or block lengths, while B0 concerns RECFM, LRECL and BLKSIZE combinations.
Typical causes
Variable-format record with a record descriptor word (RDW) length less than 4 or greater than the LRECL (return code 04, 18).
A record or block longer than the block size, or too large for the track or 32,767-byte limit (return codes 08, 0C, 14).
RECFM=F with BLKSIZE not equal to LRECL, or RECFM=FB with BLKSIZE not a multiple of LRECL (return code B0).
READ against a DASD data set opened for output only, or WRITE against one opened for input only (return code 38).
DCB parameters missing or wrong when creating a direct data set (return code 1C).
How to fix it
Read message IEC036I in the job log and look up its return code.
Correct the RECFM, LRECL and BLKSIZE so they agree; for concatenations, remember the largest BLKSIZE applies to all data sets.
If the error recurs and the program is not in error, rerun with DCB=DIAGNS=TRACE on the DD statement and a GTF trace as IEC036I describes.
Contact the IBM Support Center with the JCL and program listing if no fix is found.