Chapter 14: Further Reading

Annotated Bibliography -- Sort and Merge Operations

The following resources provide deeper exploration of the COBOL SORT and MERGE statements, external sort utilities, and the JCL considerations for sort processing on the mainframe. 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 the SORT and MERGE statements is thorough and practical, covering USING/GIVING, INPUT PROCEDURE, OUTPUT PROCEDURE, and the SD entry with clear paired-page examples. The book also addresses the JCL requirements for sort work files and provides realistic batch processing scenarios. An excellent first resource for understanding how SORT fits into complete COBOL batch programs.

2. COBOL for the 21st Century by Nancy Stern, Robert A. Stern, and James P. Ley (Wiley, 11th Edition, 2013)

The sort and merge chapter in this academic text walks through the mechanics of each SORT/MERGE clause with step-by-step examples. It is particularly strong on the distinction between INPUT PROCEDURE and USING, with diagrams showing the flow of records through the sort process. The exercises progressively build from simple USING/GIVING sorts to complex INPUT/OUTPUT PROCEDURE scenarios.

3. DFSORT Application Programming Guide by IBM (IBM Redbooks and official documentation)

While technically IBM documentation, the DFSORT Application Programming Guide reads like a comprehensive textbook on sort processing. It covers DFSORT control statements (SORT, MERGE, INCLUDE, OMIT, INREC, OUTREC, SUM), E15 and E35 user exits (which correspond to INPUT and OUTPUT PROCEDURE), and performance tuning. Essential reading for anyone who needs to understand what happens beneath the COBOL SORT verb on z/OS.


IBM Documentation

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

The programming guide's sort and merge chapter provides authoritative coverage of how Enterprise COBOL interacts with the sort subsystem. It documents the SORT-RETURN and SORT-MESSAGE special registers, the FASTSRT compiler option that enables DFSORT to handle I/O directly for USING/GIVING sorts, and the sort interface module linkage. Search for "Sorting and merging files" in the IBM Documentation portal.

5. IBM DFSORT: Getting Started (IBM Documentation)

This introductory guide to DFSORT explains the utility's architecture, its control statement syntax, and its integration with COBOL programs. It is more accessible than the full Application Programming Guide and provides a clear overview of how sort work data sets are managed, how DFSORT optimizes memory usage, and how to diagnose common sort failures. A good starting point before diving into the full reference.

6. IBM DFSORT Messages, Codes, and Diagnosis Guide (IBM Documentation)

When a SORT statement fails at runtime, the diagnostic messages come from DFSORT or SyncSort, not from COBOL. This guide documents every DFSORT message and return code, explains the most common failure scenarios (insufficient work space, sequence errors on MERGE input, I/O errors), and provides corrective actions. Indispensable for production debugging.


Online Resources

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

GnuCOBOL implements the SORT and MERGE statements using the C library qsort function rather than an external sort utility. The documentation explains behavioral differences from mainframe SORT, including how sort work files are handled in memory. Useful for readers practicing sort programs on a PC environment who need to understand which behaviors are portable and which are platform-specific.

8. Precisely SyncSort Documentation (formerly Syncsort, now Precisely)

SyncSort is the primary alternative to DFSORT on z/OS and is the dominant sort product on non-IBM mainframe platforms. The documentation covers SyncSort's control statements, its COBOL interface, and its performance optimization features. If your shop uses SyncSort rather than DFSORT, this documentation replaces resources 3, 5, and 6 as your primary sort utility reference.


Standards and Specifications

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

The COBOL standard defines the normative behavior of the SORT and MERGE statements, including the semantics of INPUT PROCEDURE, OUTPUT PROCEDURE, RELEASE, and RETURN. The standard specifies that the order of records with equal keys is undefined unless the WITH DUPLICATES IN ORDER phrase is specified. This is a critical detail for programs that depend on stable sort behavior.

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

The COBOL-85 standard formalized the SORT and MERGE syntax that remains in use today, including the ability to name multiple input files on the USING phrase and the requirement that MERGE input files be pre-sorted. Understanding the 1985 standard helps explain why certain restrictions exist (such as the prohibition of INPUT PROCEDURE with MERGE) and provides the historical context for the current language specification.


How to Use These Resources

If you want to master the COBOL SORT and MERGE syntax, start with resources 1 (Murach's) and 2 (Stern) for clear, example-driven coverage.

If you need to understand DFSORT at the utility level, focus on resources 3 (DFSORT Application Programming Guide), 5 (Getting Started), and 6 (Messages and Codes) for complete operational knowledge.

If your production environment uses SyncSort, substitute resource 8 (Precisely documentation) for the DFSORT-specific references.

If you are debugging a sort failure in production, resource 6 (DFSORT Messages) is your most immediately useful reference, followed by resource 4 (IBM Programming Guide) for understanding the COBOL-to-DFSORT interface.


Note: IBM documentation is regularly updated. Search the IBM Documentation portal for the latest edition of each title. DFSORT and SyncSort documentation may be available through your installation's library or the vendor's support portal.