Chapter 16: Further Reading

Annotated Bibliography -- Declaratives and Exception Handling

The following resources provide deeper exploration of COBOL error handling, the DECLARATIVES section, file status codes, and production-grade exception management patterns. They are organized by category and include brief descriptions to help you select the most relevant materials for your learning goals.


Books

1. Murach's Mainframe COBOL by Mike Murach and Associates (2021 edition)

Murach's treatment of file status codes and error handling is deeply practical, reflecting real-world mainframe batch processing patterns. The book emphasizes the importance of checking file status after every I/O operation and provides reusable error-handling paragraph templates that can be adapted to production programs. The paired-page format makes it easy to see the error-handling code alongside the I/O statements it protects.

2. Advanced COBOL for Structured and Object-Oriented Programming by Gary DeWard Brown (Wiley, 3rd Edition, 1998)

Brown's advanced text provides thorough coverage of the DECLARATIVES section, USE procedures, and the interaction between declarative error handlers and inline exception phrases. The discussion of error-handling design patterns is particularly valuable, including strategies for centralizing error logic, implementing retry mechanisms, and designing programs that degrade gracefully under error conditions. One of the few COBOL books that treats error handling as a design discipline rather than an afterthought.

3. Enterprise COBOL for z/OS: V6.4 Programming Guide (IBM, available in print and PDF)

While listed here as a book, the IBM Programming Guide is also available as online documentation. The chapters on file processing error handling document every file status code, the precedence rules for USE procedures, and the interaction between DECLARATIVES and the Language Environment condition handling model. This is the authoritative source for understanding how Enterprise COBOL error handling works on z/OS.


IBM Documentation

4. IBM Enterprise COBOL for z/OS: Language Reference (IBM Documentation, current edition)

The language reference provides the formal syntax and semantics for DECLARATIVES, USE AFTER STANDARD ERROR PROCEDURE, USE BEFORE REPORTING, and all inline exception phrases (INVALID KEY, AT END, ON SIZE ERROR, ON OVERFLOW, ON EXCEPTION). The file status code tables in this reference are the definitive list of all possible status values and their meanings. Essential as a desk reference during development and debugging.

5. IBM Language Environment Programming Reference (IBM Documentation)

IBM Language Environment (LE) is the common runtime that underpins Enterprise COBOL, PL/I, C, and Assembler programs on z/OS. Understanding LE condition handling is important because LE intercepts hardware exceptions (such as S0C7 data exceptions and S0CB division by zero) before COBOL's ON SIZE ERROR can act. The LE Programming Reference explains how COBOL's exception handling integrates with the broader LE condition handling model, including how to code LE user condition handlers when COBOL's built-in mechanisms are insufficient.

6. IBM z/OS MVS System Codes (IBM Documentation)

When a COBOL program abends on z/OS, the system issues an abend code (such as S0C7 for data exception, S013 for file open error, or S0CB for divide by zero) along with a reason code. This reference documents every system abend code and user abend code, providing diagnostic information that complements COBOL file status codes. Essential for production debugging when a program terminates abnormally before COBOL-level error handling can intervene.


Online Resources

7. GnuCOBOL Programmer's Guide (maintained by the GnuCOBOL community)

GnuCOBOL implements DECLARATIVES and file status codes with behavior that closely follows the COBOL standard. The documentation notes any differences from IBM Enterprise COBOL in error handling behavior, particularly around file status codes in the "9x" (implementation-defined) range. Useful for readers practicing error handling on a PC environment who need to understand which error conditions and status codes are portable.

8. IBM Developer: COBOL Cafe Community (IBM Developer platform)

The COBOL Cafe community archives contain numerous threads on debugging file I/O errors, interpreting obscure file status codes, and designing error-handling strategies for production batch programs. Searching for specific file status codes (such as "file status 39" for file attribute mismatch) often surfaces practical advice from experienced mainframe developers who have encountered and resolved the same issue.

9. IBM Z Xplore (formerly Master the Mainframe)

The IBM Z Xplore learning platform includes challenges that require handling file I/O errors and interpreting file status codes on a real z/OS system. Working through these challenges provides hands-on experience with error conditions that are difficult to simulate on a PC, such as VSAM catalog errors, DASD space exhaustion, and file disposition conflicts. Free registration provides access to a hosted z/OS environment.


Standards and Specifications

10. ISO/IEC 1989:2014 -- Programming Language COBOL (International Standards Organization)

The COBOL 2014 standard defines the normative behavior of DECLARATIVES, USE procedures, file status codes, and all inline exception phrases. The standard specifies which file status values are required (categories 0x through 4x) and which are implementation-defined (category 9x). The formal rules for USE procedure precedence and the interaction between DECLARATIVES and inline phrases are defined here. The definitive reference for understanding portable versus implementation-specific error handling behavior.

11. ANSI X3.23-1985 (COBOL-85 Standard)

The COBOL-85 standard established the file status code framework and the USE AFTER STANDARD ERROR PROCEDURE syntax that remains in use today. It also introduced the explicit scope terminators (END-READ, END-WRITE, etc.) that made inline INVALID KEY and AT END phrases practical by providing clean scope boundaries. Understanding the 1985 standard is important because the vast majority of production error-handling code follows its conventions.


How to Use These Resources

If you want practical, production-oriented error handling patterns, start with resources 1 (Murach's) and 2 (Brown) for design guidance and reusable code templates.

If you need to look up a specific file status code or abend code, use resources 4 (IBM Language Reference) for file status codes and 6 (z/OS System Codes) for abend codes.

If you want to understand how COBOL error handling fits within the z/OS runtime environment, resource 5 (Language Environment Programming Reference) explains the broader condition handling architecture.

If you are debugging a specific production error, start with the file status code in resource 4, then check the abend code in resource 6, and search the community in resource 8 for practical resolution advice.


Note: IBM documentation is regularly updated. Search the IBM Documentation portal for the latest edition of each title. File status codes in the "9x" range vary by compiler vendor and version.