Chapter 9: String Handling and Character Manipulation -- Further Reading
Books
"Murach's Mainframe COBOL" by Mike Murach and Associates Murach's coverage of STRING, UNSTRING, and INSPECT is thorough and practical, with real-world examples drawn from business data processing scenarios. The paired-pages format presents the syntax on one page and a complete working example on the facing page, making it easy to see how each clause works in context. The treatment of reference modification includes helpful diagrams showing exactly which bytes are accessed for each substring expression. Available from the Murach website and major booksellers.
"COBOL Unleashed" by Jon Wessler Wessler dedicates an entire chapter to advanced string manipulation techniques, including strategies for parsing complex record formats with multiple delimiter types and nested delimited fields. The discussion of UNSTRING with DELIMITER IN and COUNT IN is among the most detailed available in any COBOL textbook. The book also covers edge cases such as empty fields, trailing delimiters, and maximum field counts. Available through major online booksellers.
"Beginning COBOL for Programmers" by Michael Coughlan Coughlan's book provides an accessible introduction to COBOL string handling for programmers coming from other languages. Each string operation is compared to its equivalent in languages like Java and Python, helping readers map familiar concepts onto COBOL syntax. The exercises are well-designed, progressing from simple concatenation to complex parsing and data transformation scenarios. Available from Apress and major technical booksellers.
Online Resources
IBM Enterprise COBOL Language Reference -- STRING, UNSTRING, and INSPECT Statements The authoritative syntax reference for all three statements, including complete syntax diagrams, semantic rules, and detailed descriptions of every clause. This is the essential reference for understanding the precise behavior of POINTER, OVERFLOW, TALLYING, DELIMITER IN, and COUNT IN. Navigate to the Procedure Division statements section of the Enterprise COBOL Language Reference on the IBM Documentation portal.
IBM Enterprise COBOL Language Reference -- Intrinsic Functions The intrinsic functions section documents FUNCTION UPPER-CASE, FUNCTION LOWER-CASE, FUNCTION TRIM, FUNCTION LENGTH, FUNCTION REVERSE, FUNCTION ORD, FUNCTION CHAR, and other character-oriented functions. Each function entry specifies the argument type, return type, and semantic behavior. This section is essential reading for understanding the full range of string functions available in modern COBOL. Found within the same IBM Documentation portal.
IBM Enterprise COBOL Programming Guide -- Handling Strings The programming guide provides practical examples and best-practice recommendations for string handling in Enterprise COBOL. It includes guidance on choosing between INSPECT CONVERTING and FUNCTION UPPER-CASE for case conversion, performance considerations for INSPECT versus reference modification, and tips for parsing complex delimited data. Available on the IBM Documentation website.
GnuCOBOL Programmer's Guide -- String Manipulation This open-source documentation covers STRING, UNSTRING, INSPECT, and reference modification with runnable examples. GnuCOBOL supports most of the same intrinsic functions as IBM Enterprise COBOL, making it an excellent platform for hands-on practice. The guide notes any behavioral differences or unsupported features compared to the IBM implementation. Available through the GnuCOBOL project documentation.
IBM Documentation
IBM Redbook: "Modernizing COBOL Applications" (SG24-series) This Redbook discusses modernization techniques including replacing complex INSPECT and reference modification logic with calls to modern string-handling services and APIs. It provides patterns for interfacing COBOL programs with Java string-processing classes through interoperability features, which is relevant for understanding the boundaries of native COBOL string handling. Search for this title on the IBM Redbooks website.
IBM Support: "INSPECT Statement Performance Considerations" IBM support documentation includes technical articles on the runtime performance of INSPECT TALLYING, INSPECT REPLACING, and INSPECT CONVERTING. For programs that process millions of records, the choice between INSPECT CONVERTING and a sequence of INSPECT REPLACING statements can have measurable performance impact. These articles are available through the IBM Support portal by searching for COBOL INSPECT performance.
Standards and Specifications
ISO/IEC 1989:2023 -- COBOL Standard, Intrinsic Function Module The current COBOL standard defines the complete set of intrinsic functions, including several string functions not yet implemented in all compilers. Reading the standard reveals functions such as FUNCTION SUBSTITUTE, FUNCTION TRIM with explicit trim characters, and FUNCTION CONCATENATE that may be available in future compiler releases. Available for purchase through ISO or national standards bodies.
"COBOL-2002 Standard Rationale" -- String Handling Enhancements The rationale document for the COBOL-2002 standard explains why intrinsic string functions were added to the language and how they were designed to complement rather than replace the existing STRING, UNSTRING, and INSPECT statements. This document provides valuable context for understanding the design philosophy behind COBOL's string-handling capabilities. Available through INCITS archives and some technical libraries.