Chapter 10: Tables and Arrays -- Further Reading

Books

"Murach's Mainframe COBOL" by Mike Murach and Associates Murach's chapters on tables provide some of the clearest explanations of subscripts versus indexes, including diagrams showing how index values represent byte displacements rather than occurrence numbers. The treatment of SEARCH and SEARCH ALL includes decision guidelines on when to use each approach based on table size and whether the data is sorted. The examples cover common patterns such as loading a table from a file and performing lookups during transaction processing. Available from the Murach website and major booksellers.

"Enterprise COBOL for z/OS: A First Course" by Robert C. Cain Cain provides extensive coverage of multi-dimensional tables, with examples that model real business structures such as regional sales data organized by quarter and product line. The exercises require readers to build, search, and report on tables of increasing complexity, building practical skills with OCCURS, INDEXED BY, and PERFORM VARYING with AFTER. The discussion of OCCURS DEPENDING ON includes important warnings about record-length implications for file I/O. Search for this title through academic or technical publishers.

"Advanced COBOL for Structured and Object-Oriented Programming" by Gary DeWard Brown Brown's advanced text explores table-handling techniques beyond the basics, including the use of SEARCH ALL with multiple key fields, strategies for maintaining sorted tables as new entries are inserted, and the performance characteristics of serial versus binary search at different table sizes. The chapter on object-oriented COBOL shows how table-like behavior can be encapsulated in classes, providing a bridge to modern programming concepts. Available through technical booksellers.

Online Resources

IBM Enterprise COBOL Language Reference -- OCCURS Clause The definitive reference for the OCCURS clause, including the syntax for ASCENDING/DESCENDING KEY, INDEXED BY, and OCCURS DEPENDING ON. This section specifies the rules for where OCCURS can appear, how nested OCCURS defines multi-dimensional tables, and the maximum number of dimensions supported. Navigate to the Data Division section of the Enterprise COBOL Language Reference on the IBM Documentation portal.

IBM Enterprise COBOL Language Reference -- SEARCH and SEARCH ALL Statements The language reference provides the complete syntax and semantic rules for both SEARCH (serial) and SEARCH ALL (binary) statements. It documents the requirement for the index to be set before SEARCH, the sorting requirement for SEARCH ALL, and the behavior when multiple WHEN clauses are specified. This is essential reading for understanding the precise mechanics of table searching. Found in the Procedure Division statements section of the same reference.

IBM Enterprise COBOL Programming Guide -- Defining and Using Tables The programming guide devotes an entire chapter to tables, with practical advice on choosing between subscripts and indexes, loading tables from files, and handling variable-length tables. It includes performance tuning recommendations, such as using indexes instead of subscripts for frequently accessed tables and organizing multi-dimensional tables so the most frequently varying dimension is innermost. Available on the IBM Documentation website.

IBM Documentation

IBM Redbook: "COBOL and DB2 Programming Techniques" This Redbook demonstrates how COBOL tables are used in conjunction with DB2 database access, including loading reference tables from DB2 cursors, using host variable arrays for multi-row fetch operations, and maintaining in-memory caches for frequently accessed lookup data. The patterns shown are directly applicable to real-world enterprise applications. Search for this title on the IBM Redbooks website.

IBM Knowledge Center: "OCCURS DEPENDING ON Considerations" IBM provides detailed technical documentation on the complexities of OCCURS DEPENDING ON, particularly regarding its impact on record length in file operations and its interaction with REDEFINES. This documentation covers common problems such as the "complex ODO" situation where multiple ODO clauses interact, and the rules for how the ODO object must be positioned relative to the ODO subject. Available through the IBM Documentation portal.

Standards and Specifications

ISO/IEC 1989:2023 -- COBOL Standard, Table Handling Module The current COBOL standard defines the formal semantics of table handling, including the precise behavior of SEARCH and SEARCH ALL, the rules for index manipulation, and the maximum number of dimensions. The standard also defines features such as table sorting (SORT on tables) that are implemented in some but not all compilers. Available for purchase through ISO or national standards bodies.

"A Comparative Study of Array Handling in Business Programming Languages" Academic papers comparing COBOL's table handling with array facilities in other business-oriented languages provide useful perspective on COBOL's design decisions, such as the distinction between subscripts and indexes and the fixed-size nature of OCCURS. These papers can help programmers from other language backgrounds understand why COBOL tables work the way they do. Search academic databases such as ACM Digital Library for comparative language studies involving COBOL.