Further Reading — Chapter 10: Defensive Programming
Official Documentation
- IBM Enterprise COBOL for z/OS: Language Reference — Sections on FILE STATUS, USE statement, DECLARATIVES, ON SIZE ERROR, INVALID KEY, and the RETURN-CODE special register.
-
Available at: IBM Documentation (online), SC27-1408
-
IBM Enterprise COBOL for z/OS: Programming Guide — "Handling errors" chapter. Covers file status checking, error handling strategies, and debugging techniques.
-
Available at: IBM Documentation (online), SC27-1412
-
IBM z/OS MVS System Codes — Complete reference for system ABENDs (S0C7, S0C4, etc.) and user ABENDs. Essential for diagnosing production failures.
-
Available at: IBM Documentation (online), SA38-0665
-
GnuCOBOL Programmer's Guide — Error handling section. Covers GnuCOBOL-specific behavior for FILE STATUS, DECLARATIVES, and runtime error messages.
Books
-
Stern, Stern, & Ley, "COBOL for the 21st Century" — Chapter on file handling and error management. Includes progressive examples of FILE STATUS checking patterns.
-
McAfee, "COBOL: From Micro to Mainframe" — Strong coverage of DECLARATIVES and USE statements with practical examples.
-
Hunt & Thomas, "The Pragmatic Programmer" — While not COBOL-specific, chapters on defensive programming, assertions, and "dead programs tell no lies" apply directly to COBOL development philosophy.
Articles and Technical References
-
"z/OS VSAM Demystified" — IBM Redbook (SG24-6105). Chapter on VSAM return codes and file status mapping. Essential for understanding the relationship between VSAM return/reason codes and COBOL FILE STATUS.
-
"Best Practices for COBOL Error Handling" — IBM Systems Magazine article on production error handling patterns used by major financial institutions.
-
"S0C7 Prevention Guide" — Technical note on preventing data exception ABENDs through input validation and NUMERIC testing.
-
"Batch Job Restart/Recovery Patterns" — IBM Redbook chapter on checkpoint/restart techniques for long-running batch COBOL programs.
Tools
-
IBM Fault Analyzer for z/OS — Automatically analyzes ABENDs and produces human-readable diagnostic reports including the failing instruction, data values, and call chain.
-
IBM Debug Tool for z/OS — Interactive debugger that allows setting breakpoints, inspecting data values, and stepping through COBOL programs at the source level.
-
Compuware Abend-AID — Production diagnostic tool that captures ABEND information and formats it for rapid problem determination.
-
IBM File Manager for z/OS — Utility for inspecting and editing VSAM and sequential files using COBOL copybook layouts. Invaluable for diagnosing data corruption issues.
Related Topics in This Textbook
- Chapter 9: Copybooks and Code Reuse — Standardized error handling through shared copybooks (IO-STATUS, PAR-LOG)
- Chapter 11: Sequential File Processing — Applying FILE STATUS checking in the most common I/O pattern
- Chapter 12: Indexed File Processing — INVALID KEY handling for VSAM KSDS operations
- Chapter 22: Subprograms and the CALL Statement — Return code propagation between programs
- Chapter 33: Unit Testing COBOL Programs — Testing error handling paths and boundary conditions
- Chapter 38: Production Support and Debugging — Using error logs and diagnostic tools to resolve production issues