Modernization Hub

Data Exception

Enhanced Definition

A Data Exception (often resulting in an S0C7 abend) is a type of program check that occurs on IBM z/OS systems when a program attempts to perform an operation (typically arithmetic or data manipulation) on data that is not in the expected valid numeric format. It commonly arises from invalid packed decimal (`COMP-3`) or zoned decimal (`DISPLAY`) fields, signifying that the data's internal representation violates the architectural rules for the instruction being executed.

Key Characteristics

    • Program Check Type: It is a specific type of program check, identified by program status word (PSW) bit settings, indicating an error in data format.
    • S0C7 Abend Code: In COBOL and other high-level language programs, a Data Exception almost invariably leads to a system abend with code S0C7, indicating a program termination due to this specific error.
    • Invalid Numeric Data: The root cause is typically non-numeric characters in a field defined as numeric (e.g., PIC 9(n) COMP-3 or PIC 9(n) DISPLAY), or an invalid sign/digit combination in packed decimal data.
    • Instruction Specific: It occurs when z/Architecture instructions like AP (Add Packed), SP (Subtract Packed), MP (Multiply Packed), DP (Divide Packed), ZAP (Zero and Add Packed), or PACK/UNPACK encounter malformed data.
    • Hardware Detection: The z/Architecture hardware detects the invalid data format during instruction execution and raises the exception, interrupting program flow.

Use Cases

    • COBOL Arithmetic on Uninitialized/Corrupted Data: A COBOL program attempts to perform ADD or COMPUTE operations on a COMP-3 or DISPLAY numeric field that was never initialized or contains non-numeric characters due to incorrect input or a prior data overlay.
    • Data Conversion Errors: Moving a field containing spaces or alphabetic characters into a numeric field, then subsequently attempting to use that numeric field in an arithmetic operation without proper validation.
    • Reading External Files: Processing a flat file or database record where a numeric column has been corrupted or incorrectly populated with non-numeric data from an external source, leading to an exception when the program tries to process it.
    • Database Updates: An application attempts to update a numeric column in a DB2 or IMS database with a value that is not valid for the column's data type, potentially leading to a S0C7 if the application processes the invalid data after retrieval or if the database manager itself doesn't catch it first.

Related Concepts

A Data Exception is a specific instance of a Program Check, which is a hardware-detected error indicating an invalid operation or data format. It is closely tied to COBOL data types like COMP-3 (packed decimal) and DISPLAY (zoned decimal), as these are the primary numeric formats susceptible to this error. The resulting S0C7 abend is a common and critical system error that requires immediate attention and debugging. Understanding Data Exceptions is crucial for effective JCL ABEND handling and utilizing debugging tools like `IP

Related Products

Related Vendors

IBM

646 products

Related Categories

Operating System

154 products