Modernization Hub

IEC - I/O Error Code

Enhanced Definition

An I/O Error Code (IEC) is a specific numerical or hexadecimal value returned by the z/OS operating system or an access method to indicate the nature of an error encountered during an input/output operation. It provides granular detail about the failure, such as a device malfunction, data integrity issue, or an invalid request. These codes are crucial for diagnosing and resolving problems related to data access on mainframe systems.

Key Characteristics

    • Granular Error Detail: IECs provide more specific information than general return codes, pinpointing the exact cause of an I/O failure (e.g., 04 for end-of-file, 10 for a permanent I/O error, 20 for a data check).
    • Context-Dependent: The meaning of an IEC can sometimes depend on the specific access method (e.g., QSAM, VSAM), device type, or the I/O operation being performed.
    • Found in Control Blocks/Registers: IECs are typically stored in specific fields within Data Control Blocks (DCB), Data Event Control Blocks (DECB), or general-purpose registers (e.g., R15) after an I/O operation completes.
    • Complements System Codes: While system abend codes (like 001, 002, 013) indicate an I/O failure, the IEC provides the underlying reason for that failure.
    • Diagnostic Tool: Used by system programmers, application developers, and operations staff to troubleshoot I/O-related issues, debug programs, and analyze system logs.

Use Cases

    • Application Error Handling: A COBOL program might check the FILE STATUS key after a READ or WRITE statement, which often incorporates or reflects an IEC, to determine if an I/O operation was successful or to identify the specific error.
    • JCL Abend Diagnosis: When a JCL job abends with an I/O-related system code (e.g., S001, S002, S013, SB37), the IEC found in the dump or system log provides the precise reason for the abend (e.g., IEC013I for a dataset not found, IEC002I for a device error).
    • Problem Determination: System programmers analyze SYSLOG messages and SVC dumps, looking for IEC values associated with IOS (I/O Supervisor) messages to diagnose hardware failures, dataset corruption, or incorrect program logic.
    • VSAM Error Resolution: When IDCAMS utilities or VSAM applications encounter errors, IECs returned in FILE STATUS or IDCAMS messages help pinpoint issues like VSAM dataset full, record not found, or invalid key.

Related Concepts

IECs are intrinsically linked to Access Methods (like QSAM, BSAM, VSAM), which are responsible for managing data transfer between programs and I/O devices. They are often reported in conjunction with DCBs (Data Control Blocks) or ACBs (Access Method Control Blocks) which contain status information. Many common abend codes (e.g., 001, 002, 013, B37, D37, E37) are direct consequences of specific IECs, with the IEC providing the root cause. Furthermore, IECs can be complemented by SENSE data, which provides even more detailed, device-specific error information from the I/O device itself.

Best Practices:
  • Implement Robust Error Checking: Always check FILE STATUS in COBOL or return codes/registers in Assembler after every I/O operation to detect and handle IECs gracefully, preventing unexpected program termination.
  • Consult IBM Documentation: When an unfamiliar IEC is encountered, refer to the relevant IBM manuals (e.g., MVS System Codes, DFSMS Access Method Services, COBOL Language Reference) for a detailed explanation and recommended corrective actions.
  • Log Error Information: For critical applications, log the IEC along with other relevant context (dataset name, program name, timestamp) to facilitate post-mortem analysis and trend identification.
  • Automate Problem Resolution: For common IECs, consider implementing automated recovery procedures or alerts to notify operations staff, especially for issues like dataset full or device offline.
  • Use Diagnostic Tools: Leverage tools like IPCS (Interactive Problem Control System) to analyze SVC dumps and inspect control blocks (DCB, DECB) to retrieve IEC values during complex problem determination.

Related Vendors

Data Access

1 product

Tone Software

14 products

IBM

646 products

Trax Softworks

3 products

Related Categories

Operating System

154 products

Automation

222 products

Browse and Edit

64 products