COBOL Cheat Sheet
|
This content was generated with the assistance of AI and should be verified against the official documentation before being relied on in production. The reference material consulted while preparing these pages is listed in the section bibliography. |
A single-page, colour-coded summary of COBOL and its toolchain, written against ISO/IEC 1989:2023 (edition 3), GnuCOBOL 3.2 and IBM Enterprise COBOL for z/OS 6.5 on z/OS 3.2 (checked 2026-10-20) — the cobc and IBM compile options, the fixed-format ruler, the program skeleton, the data division with the PICTURE and USAGE tables and a packed-decimal nibble diagram, tables, the main statements, error handling, files with the key file status codes, SORT and MERGE, subprograms, JSON and XML, JCL, Db2, CICS, the common abends, tooling and testing, and a strip of legacy features and their modern replacements — handy for quick memorization or as a downloadable PDF desk reference.
For the full explanation, every option, and additional examples, see the dedicated pages:
Start here — COBOL Reference.
Getting started — Getting Started, COBOL History and Standards, Compilers and Dialects and Mainframe Environment Primer.
Program structure — Program Structure and Divisions, Reference Format: Fixed and Free, Words, Literals and Figurative Constants, Copybooks, COPY, and REPLACE and Compiler Directives and Conditional Compilation.
Data division — Data Division and Level Numbers, The PICTURE Clause, USAGE and Numeric Representation, VALUE, INITIALIZE and Condition Names, REDEFINES, RENAMES and TYPEDEF, National UTF-8 and Code Pages, Tables and OCCURS, Searching and Sorting Tables and Pointers and Dynamic Storage.
Procedure division — MOVE and Data Movement, Arithmetic and COMPUTE, Conditions, IF and EVALUATE, PERFORM and Structured Programming, Strings: STRING, UNSTRING and INSPECT, Intrinsic Functions, Dates and Times, ACCEPT, DISPLAY and Console I/O and Error Handling and Declaratives.
Files — File Concepts: SELECT and FD, Sequential Files, Indexed Files and VSAM, Relative Files, File Status Codes, Sort and Merge and Reports and Report Writer.
Modular programming — Subprograms, CALL and Linkage, User-Defined Functions and Prototypes, Interoperability with C, Java and Python and Object-Oriented COBOL.
Data interchange — JSON GENERATE and PARSE and XML GENERATE and PARSE.
Mainframe batch and middleware — JCL for COBOL Programmers, Compiling, Linking and Language Environment, Datasets and Mainframe Utilities, Embedded SQL and Db2, CICS Online Programming and IMS DL/I Overview.
Development practices — Modern Tooling: VS Code and Zowe, Debugging and Troubleshooting, Testing COBOL Programs, Performance and Compiler Options, Coding Standards and Best Practices and DevOps and CI/CD for COBOL.
Evolution and reference — Modernization Strategies, Legacy Features and Migration and What’s New in COBOL.
References
The PDF summarizes the official documentation; each source is cited in full on the page listed above that covers it, and in the section bibliography.