Preface

Why This Book Exists

In 2024, a large North American bank discovered that a single retirement -- one programmer leaving after thirty-seven years on the job -- threatened the stability of a batch processing system that settled over four billion dollars in interbank transfers every night. The code was written in COBOL. No one remaining on the team could read it fluently. The bank spent eleven months and an undisclosed sum hiring consultants, reverse-engineering business rules, and ultimately rewriting only the most fragile modules, while the rest of the system continued to run as it had since 1987.

This story is not unusual. It is not even remarkable by the standards of the global COBOL landscape. It is simply one of thousands of quiet crises unfolding across financial institutions, government agencies, insurance companies, and healthcare organizations around the world. And it is the reason this book exists.

COBOL -- the Common Business-Oriented Language -- was designed in 1959 by a committee of industry and government representatives who wanted a programming language that could be read by managers, written by programmers, and run on any manufacturer's hardware. The language that emerged was verbose, structured, and unapologetically oriented toward the problems of business: processing transactions, generating reports, managing records, and performing the precise decimal arithmetic that commerce demands. More than six decades later, COBOL remains in production at a scale that defies the assumptions of the modern software industry.

This book was written to address a simple and urgent reality: the world runs on COBOL, and the world is running out of people who know it.

COBOL by the Numbers

The statistics surrounding COBOL's footprint in global computing are so large that they can feel abstract, so it is worth pausing to consider what they actually represent.

There are an estimated 220 billion lines of COBOL code in active production today. To put that figure in perspective, if a single programmer were to read those lines at a pace of one line per second, working eight hours a day with no breaks, it would take over nineteen thousand years to finish. This is not legacy code in the sense that the technology industry typically uses the term -- outdated software waiting to be replaced. This is infrastructure. It is the computational foundation of the global economy.

Approximately 95 percent of all ATM transactions worldwide touch COBOL code at some point in their processing chain. Every time a customer inserts a card, enters a PIN, and withdraws cash, a COBOL program running on a mainframe is likely validating the account, checking the balance, authorizing the withdrawal, updating the ledger, and generating the audit trail. The entire interaction, from card insertion to cash dispensation, typically completes in under three seconds.

COBOL systems process an estimated three trillion dollars in daily commerce globally. This figure encompasses interbank transfers, credit card authorizations, insurance claim adjudications, payroll processing, tax filings, and benefits disbursements. The United States Social Security Administration, which serves over seventy million beneficiaries, runs its core systems on COBOL. So do the majority of the world's fifty largest banks, most state unemployment insurance systems, and a significant share of global supply chain logistics platforms.

Eighty percent of all in-person transactions in the retail and financial sectors involve COBOL processing at some stage. The airline reservation systems that book millions of flights per year, the freight logistics platforms that track global shipping, and the health insurance systems that process billions of claims annually all depend on COBOL code that, in many cases, has been running reliably for decades.

These are not figures from advocacy groups trying to promote the language. They are consensus estimates drawn from industry analyses by organizations including Micro Focus, IBM, the Government Accountability Office, and Reuters. COBOL is not a historical curiosity. It is, by any reasonable measure, one of the most consequential technologies in the history of computing.

The Workforce Crisis

The challenge facing the COBOL ecosystem is not one of technology. The language is stable, well-specified, and supported by mature compilers and toolchains. The challenge is human.

The average age of a COBOL programmer in the workforce today is estimated to be between fifty-five and sixty years old. Many of the developers who built and maintained the systems that run the world's financial infrastructure entered the workforce in the 1970s and 1980s. They are now at or past retirement age. According to industry surveys, roughly seventy-five percent of enterprise COBOL developers plan to retire within the next ten years. Some already have. The COVID-19 pandemic in 2020 exposed this vulnerability with startling clarity when state unemployment systems -- nearly all of them COBOL-based -- buckled under unprecedented claim volumes, and governors publicly appealed for COBOL programmers to come out of retirement.

The pipeline of new COBOL talent is alarmingly thin. Most university computer science programs dropped COBOL from their curricula during the 1990s and 2000s, replacing it with Java, Python, and web technologies. This was understandable from an academic perspective but catastrophic from a workforce planning standpoint. The result is a generation gap: the people who understand the systems are leaving, and the people entering the workforce have never been exposed to the language those systems are written in.

This gap cannot be closed by automated modernization tools alone. While there are ongoing efforts to migrate COBOL systems to modern platforms and languages, the sheer scale of the installed base, the complexity of the embedded business logic, and the risk associated with rewriting mission-critical financial systems mean that COBOL will remain in production for decades to come. The International Data Corporation and other research firms project that COBOL will continue to be a critical enterprise language through at least the 2040s.

The world does not merely need people who can read COBOL. It needs people who can write it, debug it, extend it, optimize it, and integrate it with modern systems. That is the gap this book is designed to help close.

Who This Book Is For

This book is written for anyone who wants to learn COBOL thoroughly, from the foundations of the language to the realities of enterprise-scale deployment. It assumes no prior knowledge of COBOL, but it does assume that the reader has some experience with programming in any language. If you can write a loop, declare a variable, and understand the concept of a function, you have enough background to begin.

We have designed this book with four primary audiences in mind.

University students studying computer science, information systems, or software engineering will find a structured curriculum that progresses from introductory concepts through advanced enterprise topics. The chapter organization, exercises, quizzes, and case studies are designed to support both self-study and classroom adoption. Instructors can map the nine parts of this book to a two-semester sequence or select specific parts for a single-semester course on enterprise computing.

Career changers entering the technology workforce -- or pivoting within it -- will find that COBOL offers a compelling career path. Demand for COBOL skills consistently outstrips supply, salaries for COBOL developers are competitive with or above market rates for equivalent experience levels, and the work itself is meaningful: you will be maintaining and extending systems that directly serve millions of people. This book provides not only the technical skills but also the contextual understanding of enterprise environments that employers expect.

Experienced programmers from other languages who need to add COBOL to their skill set, whether for a specific project, a client engagement, or professional development, will benefit from the book's structured but comprehensive approach. We do not dwell on concepts you already understand, such as what a variable is, but we do take care to explain where COBOL diverges from the conventions of languages like Java, Python, or C, because those divergences are significant and often surprising.

Mainframe professionals who work adjacent to COBOL systems -- operations staff, database administrators, systems programmers, and project managers -- will find the book useful for deepening their understanding of the application code that runs on the platforms they support.

How This Book Is Organized

The book is divided into nine parts comprising forty-two chapters, progressing from foundational concepts to enterprise-scale development.

Part I: Foundations (Chapters 1--6) introduces the COBOL language, its history and relevance, program structure, data types, the PICTURE clause, WORKING-STORAGE, basic input/output, and arithmetic operations. By the end of this part, you will be writing complete, functioning COBOL programs.

Part II: Control Flow and Data Manipulation (Chapters 7--10) covers conditional logic, iteration with the PERFORM verb, string handling, and tables and arrays, giving you the tools to write programs with meaningful logic.

Part III: File Processing (Chapters 11--16) is where COBOL truly comes into its own. You will learn sequential, indexed, and relative file organizations; the SORT and MERGE verbs; the Report Writer module; and declaratives for exception handling.

Part IV: Modular Programming (Chapters 17--21) covers subprograms and the CALL verb, copybooks, intrinsic functions, debugging techniques, and coding standards -- the practices that distinguish professional COBOL development from ad hoc scripting.

Part V: Enterprise Data Access (Chapters 22--26) introduces embedded SQL with DB2, advanced DB2 techniques, CICS fundamentals and advanced topics, and IMS database access -- the middleware and database technologies that COBOL programs interact with in production environments.

Part VI: The Mainframe Environment (Chapters 27--32) covers JCL essentials, batch processing, mainframe utilities, z/OS dataset management, z/OS security, and performance tuning -- the operational context in which enterprise COBOL runs.

Part VII: Financial Systems (Chapters 33--36) applies everything you have learned to the domain where COBOL dominates: financial calculations, banking and payments processing, insurance and government systems, and accounting and general ledger applications.

Part VIII: Modern COBOL (Chapters 37--40) addresses object-oriented COBOL, modern integrations with web services and APIs, legacy modernization strategies, and testing and quality assurance.

Part IX: Capstone (Chapters 41--42) brings the book to a close with a comprehensive capstone project that integrates skills from across all preceding parts, and a career guide for entering or advancing in the COBOL profession.

The Dual-Platform Approach

One of the defining decisions of this book is its dual-platform approach. Every concept, technique, and exercise is presented with support for two COBOL environments: GnuCOBOL and IBM Enterprise COBOL.

GnuCOBOL is a free, open-source COBOL compiler that runs on Windows, macOS, and Linux. It is an excellent learning tool because it allows you to write, compile, and run COBOL programs on your personal computer with no special hardware, no license fees, and no mainframe access required. For students and self-learners, GnuCOBOL removes every barrier to getting started.

IBM Enterprise COBOL is the industry-standard compiler for z/OS mainframe environments. It is the COBOL that runs in production at banks, insurance companies, government agencies, and Fortune 500 corporations. Understanding its features, extensions, and conventions is essential for anyone who intends to work professionally with COBOL.

Throughout the text, platform-specific information is clearly marked with [GnuCOBOL] and [IBM Enterprise COBOL] tags, so you always know which environment a particular instruction, syntax variant, or configuration step applies to. The core COBOL language is the same across both platforms, but the differences in compiler options, runtime behavior, and ecosystem tooling are real, and we address them honestly.

The Finance and Legacy Industry Focus

COBOL was designed for business, and this book takes that heritage seriously. While the foundational and intermediate chapters use general-purpose examples, the advanced chapters draw heavily on the financial services, insurance, and government domains where COBOL is most deeply entrenched. You will work with realistic scenarios involving transaction processing, ledger management, regulatory reporting, payment systems, and claim adjudication.

This focus is deliberate. If you learn COBOL, the most likely environment in which you will use it is a financial institution or a government agency processing high-volume, high-value transactions. We want to prepare you not just for the syntax of the language but for the context in which it operates.

Grace Hopper's Vision

No book about COBOL would be complete without acknowledging Rear Admiral Grace Murray Hopper, whose vision of a machine-independent, English-like programming language for business applications led directly to the creation of COBOL. Hopper understood, decades before the rest of the industry caught up, that programming languages should serve people, not just machines. She championed readability, portability, and accessibility at a time when programming was the exclusive province of specialists writing in machine code and assembler.

COBOL's verbosity -- the feature that modern programmers most often criticize -- was a deliberate design choice rooted in Hopper's conviction that code should be comprehensible to the business professionals who depended on it. That conviction has aged remarkably well. In an era when the maintainability of software systems is recognized as one of the most important qualities of code, COBOL's self-documenting nature looks less like a relic and more like a prescient design decision.

This book is written in the spirit of Hopper's original vision: that the purpose of a programming language is to make it possible for human beings to communicate with machines in terms that human beings can understand. COBOL has fulfilled that purpose, without interruption, for over sixty-five years. It deserves to be learned well, taught well, and respected for what it is: the quiet engine of the global economy.

We hope this book serves you well on that journey.


The authors January 2026