Module 1: Abend Codes
S213- Open Error
S213 abends the step when OPEN fails on a dataset - the dataset could not be opened for processing.
What it means
- The OPEN macro returned an error, so the program could not start reading or writing the dataset.
- S213 is a dataset/JCL problem, not a program logic problem.
Common causes
- Wrong dataset name (DSN) spelling on the DD statement.
- The dataset was deleted or was never created (catalog lookup fails).
- DCB mismatch - wrong RECFM, LRECL or BLKSIZE coded on the DD or in the program.
- Security denial (for example, RACF) on the dataset.
- DISP=OLD requested on a dataset that is already in use by another job.
How to find it
- Look for the IEC141I message in the job log - it carries the reason code for the open failure.
- The reason code tells you whether the dataset was not found, the DCB was wrong, or access was denied.
- Check the DD name, DSN and DCB against the dataset catalog entry.
How to fix it
- Verify the dataset exists with the exact DSN (use 3.4 in ISPF or LISTCAT).
- Correct the DCB attributes (RECFM, LRECL, BLKSIZE) to match the real dataset.
- Check the DISP - use DISP=SHR for shared input instead of DISP=OLD when another job may hold it.
- Confirm you have RACF read/update access to the dataset.
Example
- Wrong DSN that causes S213:-
//INFILE DD DSN=MY.INPUT.FIEL,DISP=SHR
- Corrected DD with the right dataset name and matching DCB:-
//INFILE DD DSN=MY.INPUT.FILE,DISP=SHR, // DCB=(RECFM=FB,LRECL=80,BLKSIZE=800)
