# IEC020I: 001 abend, I/O error with no error routine

Source: https://wndsoftware.com/mainframe-errors/iec020i

### IEC020I: 001 abend, I/O error with no error routine

IEC020I means a program hit an I/O error, or a condition the access method treats as one, with no error routine to handle it, so z/OS ended the step with system abend 001. The return code after 001 says which case it was.


#### Other names for this code

Also written as `IEC020I 001`, `IEC020I 001-4`, `IEC020I 001-5`, `abend 001`, `S001`, `system abend 001`, `IEC020I`.


### What it means

Programs that read and write sequential files, libraries and direct files go through access methods such as QSAM, BSAM and BPAM. A program can give the access method an error routine, called a SYNAD exit, to deal with I/O errors. When an error happens and there is no SYNAD exit, or the exit returns and lets the error stand, the access method can't go on. z/OS writes IEC020I and ends the step with abend 001.

The message has two forms. For a data set on a device, it gives the abend and return code, the module, the job and step names, the DD name, the device number, the volume serial and the data set name. For a SYSIN or SYSOUT data set or a z/OS UNIX file, the last field is a code instead. USS means a UNIX file, JES means a subsystem data set, and three or four hex digits are a device number.

The return codes are single digits. 0 means the record length or block size in the program or the DD statement doesn't match the data set. 1 means an I/O error with no SYNAD exit. That includes a real device error, but also writing to a file opened for input, reading one opened for output, RECFM=U with no record length, and a concatenated data set whose attributes differ from the first one in a way the open couldn't catch. 2 means an error while closing the data set. 3 and 4 are QSAM cases where the error options in the DCB didn't allow the program to carry on. 5 means a QSAM GET after end of file. 6 means a positioning error while reading a UNIX file.

For a partitioned concatenation, the data set name in the message is the first one in the concatenation, which may not be the one that failed.


### Common causes

- The record length or block size coded in the program or on the DD statement doesn't match the data set (return code 0).
- The program asked QSAM for another record after it had already reached end of file (return code 5). This is a logic error in the program's read loop.
- A data set in a concatenation has a different record format, length or block size from the first one.
- The program wrote to a file it opened for input, or read one it opened for output.
- A real hardware or media error on the disk or tape. In that case IEA000I appears in the job log as well.
- An error while the data set was being closed (return code 2).


### How to find the problem

- In SDSF, open JESYSMSG and find IEC020I. Note the return code after 001, the DD name and the data set name.
- Look for IEA000I just before it. If it is there, the cause is a device or media error rather than the program.
- For return code 0 or 1, compare the data set's real attributes (ISPF option 3.4, I line command) with the DCB values on the DD statement and the record layout in the program.
- If the DD name has a hyphen and a number after it, or names a concatenation, check every data set in that concatenation. The one the message names may not be the one at fault.
- For return code 5, look at the program's read loop and how it handles end of file.


### How to fix it

- Remove hard-coded LRECL or BLKSIZE values from the DD statement for existing data sets, and make the program's record length match the data set.
- Fix the read loop so it stops after end of file.
- Make every data set in a concatenation use the same record format and record length, or split them into separate steps.
- Open the file in the mode the program really uses it.
- For a hardware or media error, pass IEA000I to the storage or operations team. Restore the data set from a backup if it is damaged.


### IBM documentation

[IBM documentation: IEC020I](https://www.ibm.com/docs/en/zos/3.1.0?topic=messages-iec020i). Use the documentation for your installed release.

[Report a correction to WND Software](https://wndsoftware.com/contact#message).

Last reviewed 2026-10-18 by the WND Software team. Written in our own words. For the full reference, check IBM’s documentation for your z/OS release.


### Related codes

[S001 I/O error Read →](https://wndsoftware.com/mainframe-errors/s001)
[IEC141I Data set open failed (abend 013) Read →](https://wndsoftware.com/mainframe-errors/iec141i)
[IEF450I Job step abended Read →](https://wndsoftware.com/mainframe-errors/ief450i)
[File status 30 Permanent error, no further information Read →](https://wndsoftware.com/mainframe-errors/file-status-30)
[S002 Invalid record or block (QSAM or BSAM) Read →](https://wndsoftware.com/mainframe-errors/s002)

### Questions


#### Does abend 001 always mean bad hardware?

No. Most 001 abends come from programs and JCL, such as a record length mismatch or a read after end of file. A real hardware error usually comes with IEA000I in the job log.


#### What does IEC020I 001-5 mean?

The program asked QSAM for another record after it had already reached end of file. The fix is in the program's read loop.


#### Why is the data set name in the message the wrong one?

For a concatenation of libraries, the message shows the first data set in the concatenation. The one that failed may be further down the list.

[z/OS and language runtime messages](https://wndsoftware.com/mainframe-errors/zos-messages) · [IDC3351I](https://wndsoftware.com/mainframe-errors/idc3351i) · [IEC030I](https://wndsoftware.com/mainframe-errors/iec030i)

[← All error codes](https://wndsoftware.com/mainframe-errors/)
