How to Use This Book

This guide explains how the book is organized, how each chapter is structured, and how to get the most out of the material regardless of your background. Read this section before diving into the chapters -- the fifteen minutes you invest here will save you hours of confusion later.

Book Organization: Nine Parts

The book is divided into nine parts that form a deliberate progression from foundational concepts to enterprise-scale professional development. Each part builds on the knowledge established in the parts before it.

Part I: Foundations (Chapters 1--6) establishes the groundwork. You will learn what COBOL is, why it matters, how a COBOL program is structured, and how to work with data types, the PICTURE clause, WORKING-STORAGE, basic input/output, and arithmetic. By the end of Part I, you will be writing complete, compilable programs that accept input, perform calculations, and produce output.

Part II: Control Flow and Data Manipulation (Chapters 7--10) adds logical complexity. You will learn conditional statements (IF, EVALUATE), iteration with the PERFORM verb in its many forms, string handling operations (INSPECT, STRING, UNSTRING), and tables and arrays. These chapters give you the control structures needed to write programs with real business logic.

Part III: File Processing (Chapters 11--16) covers the area where COBOL has no peer among general-purpose languages. You will learn sequential file processing, indexed file organization with ISAM and VSAM concepts, relative files, the SORT and MERGE verbs, the Report Writer module, and declaratives for exception handling. File processing is the heart of enterprise COBOL, and this part treats it with the depth it deserves.

Part IV: Modular Programming (Chapters 17--21) transitions you from writing individual programs to building maintainable systems. Topics include subprograms and the CALL verb, copybooks and the COPY statement, intrinsic functions, debugging techniques and tools, and coding standards and best practices used in professional shops.

Part V: Enterprise Data Access (Chapters 22--26) introduces the middleware and database technologies that COBOL programs interact with in production. You will learn embedded SQL with DB2, advanced DB2 programming including cursors, dynamic SQL, and stored procedures, CICS fundamentals for online transaction processing, advanced CICS techniques, and IMS hierarchical database access.

Part VI: The Mainframe Environment (Chapters 27--32) provides the operational context that every COBOL developer working on z/OS must understand. You will learn JCL (Job Control Language) essentials, batch processing patterns, mainframe utilities like IDCAMS and DFSORT, z/OS dataset management, security with RACF, and performance tuning.

Part VII: Financial Systems (Chapters 33--36) applies your accumulated skills to the domains where COBOL dominates. Chapters cover financial calculations with precise decimal arithmetic, banking and payment processing systems, insurance and government applications, and accounting and general ledger systems.

Part VIII: Modern COBOL (Chapters 37--40) addresses the present and future of the language. You will learn object-oriented COBOL, modern integrations with web services, REST APIs, and JSON/XML processing, legacy modernization strategies, and testing and quality assurance practices.

Part IX: Capstone (Chapters 41--42) brings everything together. Chapter 41 is a comprehensive capstone project that integrates skills from across the entire book into a realistic enterprise application. Chapter 42 is a career guide that covers the COBOL job market, interview preparation, certifications, and professional development.

Chapter Structure

Every chapter in this book follows a consistent structure designed to support multiple learning styles and use cases. Once you are familiar with the pattern, you can navigate any chapter efficiently.

index.md -- Main Content

The index.md file contains the primary instructional material for the chapter. This is where concepts are explained, syntax is introduced, and examples are presented. Each chapter's main content includes:

  • Learning objectives stated at the beginning, so you know exactly what skills and knowledge you should gain
  • Conceptual explanations written in clear prose with real-world context
  • Syntax diagrams and formal specifications for every COBOL verb and clause introduced
  • Annotated code examples that demonstrate each concept in working programs
  • Platform notes marked with [IBM Enterprise COBOL] and [GnuCOBOL] tags where compiler behavior differs
  • Best practices and common pitfalls drawn from professional experience

exercises.md -- Five-Tier Exercises

The exercises.md file contains practice problems organized into five tiers based on Bloom's revised taxonomy of cognitive skills. This tiered approach ensures that you move beyond rote memorization to genuine understanding and creative application. The five tiers are described in detail in the "Exercise Tiers" section below.

quiz.md -- Knowledge Check

The quiz.md file contains a set of questions designed to verify your understanding of the chapter's key concepts. Quiz questions include multiple choice, true/false, fill-in-the-blank, and short answer formats. Use the quiz as a self-assessment tool after completing the main content. If you cannot answer a quiz question confidently, revisit the relevant section of the chapter before moving on.

Case Studies

Most chapters include one or two case study files (e.g., case-study-01.md, case-study-02.md) that present realistic business scenarios requiring application of the chapter's concepts. Case studies are longer and more complex than exercises; they simulate the kinds of problems you will encounter in professional COBOL development. Each case study includes a scenario description, requirements, sample data, and a guided analysis or solution walkthrough.

key-takeaways.md -- Chapter Summary

The key-takeaways.md file provides a concise summary of the most important points from the chapter. Use it for quick review before an exam, before starting the next chapter, or when you return to the material after a break.

further-reading.md -- Additional Resources

The further-reading.md file lists books, articles, official documentation, and online resources for deeper exploration of the chapter's topics. Entries are annotated with brief descriptions to help you decide which resources are worth your time.

code/ -- Source Code Directory

The code/ directory within each chapter contains all COBOL source files, copybooks, sample data files, and JCL examples referenced in the chapter. Every code example that appears in the text is available as a complete, compilable source file in this directory. File names match the labels used in the text, so you can easily find the code you need.

Four Reading Paths

Not every reader needs to follow the same route through this book. Below are four recommended reading paths tailored to different backgrounds and goals.

Path 1: Complete Beginner

You have programming experience in at least one language but have never seen COBOL before.

Follow the book in order, from Chapter 1 through Chapter 42. The chapters are sequenced so that each one builds on the previous. Do not skip Part I even if the early material feels slow -- COBOL's conventions around data definition, the PICTURE clause, and the division-based program structure are unlike anything in modern languages, and misunderstandings at this stage will compound later.

Spend extra time on Part III (File Processing), as this is where COBOL's design philosophy becomes fully apparent and where many newcomers struggle. Complete the exercises at every tier and use the quizzes as checkpoints.

Estimated time: 16--20 weeks at 10--15 hours per week.

Path 2: Experienced Programmer New to COBOL

You are comfortable with multiple programming languages and want an efficient path to COBOL proficiency.

Start with Chapter 1 for context, then move through Chapters 2--6 at a brisk pace, focusing on how COBOL's data model and program structure differ from what you know. You can skim the conceptual explanations and focus on the syntax and code examples. Move through Part II quickly, paying special attention to the PERFORM verb in Chapter 8, as COBOL's iteration model is distinctive.

Slow down for Parts III--V. File processing, subprograms, and enterprise data access are where COBOL's unique value lies, and they cannot be understood by analogy to other languages. Complete the Apply and Analyze tier exercises in these parts.

Parts VI and VII can be read selectively based on your professional needs. Part VIII will be particularly relevant if you are integrating COBOL with modern systems. Finish with the capstone project in Chapter 41.

Estimated time: 10--14 weeks at 10--15 hours per week.

Path 3: Mainframe Professional

You work with z/OS, JCL, DB2, or CICS but have limited COBOL programming experience.

Start with Chapters 1--3 to understand program structure, then proceed through Parts I and II to build your COBOL syntax foundation. You can move quickly through Part VI (Mainframe Environment), as much of this material will be review for you, but read the chapters carefully for the COBOL-specific aspects you may not have encountered from the application side.

Focus your deepest effort on Parts III--V and Part VII, which connect COBOL programming to the mainframe systems you already know. The case studies in these parts will be especially valuable because you will recognize the environments they describe.

Estimated time: 12--16 weeks at 8--12 hours per week.

Path 4: Career Changer

You are transitioning into COBOL development, perhaps from a non-technical background or from a different area of technology, and your primary goal is employment.

Follow Path 1 through Part IV. Then read Chapters 22--24 (DB2 and CICS fundamentals) and Chapter 27 (JCL essentials) before proceeding to Chapter 42 (Career Guide). This gives you the core skills that employers test for in entry-level COBOL interviews.

After securing your first position, return to the chapters you skipped, particularly the advanced topics in Parts V, VI, and VII, and work through them alongside your on-the-job experience. The book is designed to serve as a reference throughout your career, not just during initial learning.

Estimated time: 12--16 weeks at 12--15 hours per week for initial preparation.

Conventions Used in This Book

Source Code Format

COBOL has two source code formats, and this book uses both where appropriate.

Fixed format is the traditional COBOL layout inherited from the punch card era. Columns 1--6 are the sequence number area, column 7 is the indicator area (used for comments, continuation, and debugging lines), columns 8--11 are Area A (for division, section, and paragraph headers and level numbers 01 and 77), columns 12--72 are Area B (for statements and clauses), and columns 73--80 are the identification area. Fixed format is the default in IBM Enterprise COBOL and is used in the majority of production code worldwide.

Free format removes column restrictions and allows code to be written anywhere on the line. It is the default in GnuCOBOL 3.x and is increasingly supported in modern COBOL compilers. Free format is easier for learners accustomed to languages like Python or Java, where indentation is flexible.

In this book, most code examples are presented in fixed format to match production conventions, with explicit notes where free format is used or where the two formats differ in behavior.

Platform Markers

Where IBM Enterprise COBOL and GnuCOBOL differ in syntax, compiler options, runtime behavior, or available features, the differences are marked with clearly visible tags:

[IBM Enterprise COBOL] -- Information specific to the IBM Enterprise COBOL compiler running on z/OS.

[GnuCOBOL] -- Information specific to the GnuCOBOL open-source compiler running on Windows, macOS, or Linux.

When no marker is present, the material applies to both environments. We have tested every code example on both platforms unless a platform marker indicates otherwise.

COBOL Uppercase Convention

COBOL reserved words are traditionally written in uppercase: MOVE, PERFORM, IF, DISPLAY, COMPUTE, READ, WRITE. This book follows that convention in all code examples. While modern compilers accept lowercase and mixed-case COBOL, uppercase remains the dominant convention in production codebases, in IBM documentation, and in the COBOL standard itself. Learning to read and write uppercase COBOL is essential for professional practice.

User-defined names (data items, paragraph names, section names, file names) are written in uppercase with hyphens separating words: WS-CUSTOMER-NAME, PROCESS-TRANSACTION, EMPLOYEE-RECORD. This matches prevailing industry practice.

Code Block Formatting

Code examples in this book are presented in labeled, syntax-highlighted blocks. Each example includes:

  • A descriptive label or figure number for reference
  • The complete source code, formatted for readability
  • Annotations or line-by-line explanations for complex examples
  • Expected output, where applicable

Partial code snippets (showing only the relevant portion of a program) are clearly marked as such. When a snippet is shown, the chapter text explains where it fits within the full program structure, and the complete source file is available in the chapter's code/ directory.

Inline Code and Terminology

COBOL verbs, clauses, and keywords referenced in running text are formatted in monospace type: "Use the INSPECT verb to count or replace characters within a string." Technical terms are bolded at their first significant appearance and defined in context.

Exercise Tiers

The exercises in each chapter are organized into five tiers of increasing cognitive complexity. This system is grounded in Bloom's revised taxonomy and is designed to develop not just your knowledge of COBOL syntax but your ability to think in COBOL and solve real problems.

Tier 1: Recall

Recall exercises test your ability to remember facts, syntax, and definitions. These are the simplest exercises and typically involve identifying COBOL verbs, stating the purpose of a clause, or recalling the correct format of a statement. If you cannot complete the Recall exercises for a chapter, you need to reread the material.

Example: "What are the four divisions of a COBOL program, and in what order must they appear?"

Tier 2: Understand

Understand exercises test your ability to explain concepts in your own words, compare and contrast related features, or predict the behavior of a code snippet. These exercises require comprehension beyond memorization.

Example: "Explain the difference between PERFORM UNTIL and PERFORM VARYING. Under what circumstances would you choose one over the other?"

Tier 3: Apply

Apply exercises require you to write code that solves a specific, well-defined problem using the techniques from the chapter. These are the core hands-on exercises, and you should compile and run your solutions using GnuCOBOL (or IBM Enterprise COBOL if available).

Example: "Write a COBOL program that reads a sequential file of employee records and produces a report listing all employees whose salary exceeds a threshold specified in WORKING-STORAGE."

Tier 4: Analyze

Analyze exercises present you with code, output, or scenarios that require you to examine, debug, compare, or deconstruct. You may be asked to find errors in a program, explain why a program produces unexpected output, or evaluate the trade-offs between two valid approaches.

Example: "The following program is intended to calculate compound interest but produces incorrect results for certain inputs. Identify the error, explain why it occurs, and provide a corrected version."

Tier 5: Create

Create exercises are open-ended design and implementation challenges. You are given a business requirement and must design the data structures, program logic, file layouts, and output formats yourself. These exercises simulate the work of a professional COBOL developer and often span multiple concepts from the chapter and previous chapters.

Example: "Design and implement a batch processing system that reads transaction records from an indexed file, validates each transaction against a master account file, posts valid transactions, generates an exception report for invalid transactions, and produces an end-of-day summary."

We recommend that all readers complete at least the Recall, Understand, and Apply exercises for every chapter. The Analyze and Create exercises are strongly recommended for readers following the career changer path or anyone who intends to work professionally with COBOL.

Setting Up Your Environment

To work through the code examples and exercises in this book, you need a COBOL compiler installed on your computer. We recommend GnuCOBOL for all readers, as it is free, open-source, and runs on all major operating systems.

GnuCOBOL Installation

Detailed installation instructions for Windows, macOS, and Linux are provided in the companion compiler-setup.md file included with this book. In brief:

  • Windows: Install via the pre-built binary distribution or through MSYS2/MinGW. The compiler-setup.md file provides step-by-step instructions.
  • macOS: Install via Homebrew with brew install gnucobol.
  • Linux: Install via your distribution's package manager (e.g., apt install gnucobol on Debian/Ubuntu, dnf install gnucobol on Fedora).

After installation, verify your setup by compiling and running the "Hello, COBOL" program from Chapter 1:

cobc -x -free hello.cob
./hello

IBM Enterprise COBOL Access

If you want to work with IBM Enterprise COBOL, several options are available:

  • IBM Z Xplore provides free access to a z/OS environment for learning purposes.
  • IBM Wazi as a Service provides cloud-based z/OS development environments.
  • Many universities and employers provide access to z/OS systems for students and staff.

Using IBM Enterprise COBOL is not required to complete this book, but it is recommended for readers in Part V (Enterprise Data Access) and Part VI (The Mainframe Environment), where the content is tightly coupled to z/OS features.

Working with the Code Examples

Every chapter's code/ directory contains ready-to-compile source files. We recommend the following workflow:

  1. Read the relevant section of the chapter
  2. Open the corresponding source file from the code/ directory
  3. Study the code and compare it to the text's explanation
  4. Compile and run the program
  5. Modify the program to experiment with the concepts
  6. Attempt the exercises, writing your solutions from scratch

Do not simply read the code examples without compiling and running them. COBOL is a language where details matter -- a misplaced space, a wrong level number, a missing period -- and the only way to internalize those details is through hands-on practice.

Tips for Success

Type the code yourself. Resist the temptation to copy and paste. The physical act of typing COBOL code, with its level numbers, PICTURE clauses, and paragraph structures, builds muscle memory and helps you internalize the syntax.

Read error messages carefully. COBOL compiler error messages are often more informative than those from modern language compilers. They frequently tell you not just what is wrong but where and why. Learn to read them.

Embrace the verbosity. If you come from Python, JavaScript, or another concise modern language, COBOL will feel verbose. That verbosity is intentional. COBOL was designed to be readable by non-programmers, and its self-documenting nature is one of the reasons that COBOL programs written in the 1980s are still maintainable today. Do not fight the verbosity; learn to appreciate it as a feature.

Do the exercises at every tier. It is tempting to read the chapter, nod in understanding, and move on. Do not do this. Understanding and ability are different things. The exercises, especially at the Apply and Create tiers, are where real learning happens.

Keep a reference card. As you learn COBOL verbs and clauses, maintain a personal reference card or cheat sheet. COBOL has a large vocabulary, and having a quick-reference document that you built yourself is more useful than any pre-made reference.

Join the community. The COBOL community is small but welcoming. The GnuCOBOL forums, the COBOL subreddit, and various LinkedIn groups are good places to ask questions, share your progress, and connect with professionals. Do not learn in isolation.

Be patient with yourself. COBOL is not harder than other languages, but it is different. The concepts you learned in other languages -- variables, loops, conditions, functions -- all apply, but the way COBOL expresses them is its own. Give yourself time to adjust to COBOL's way of thinking, and trust that fluency will come with practice.