COBOL
The business programming language that still runs the world - powering banking, government, and enterprise systems for over 60 years.
Created by CODASYL Committee (Grace Hopper, technical consultant)
COBOL (COmmon Business-Oriented Language) is one of the oldest programming languages still in active production use. Despite decades of predictions of its demise, COBOL reportedly continues to process the majority of ATM transactions and credit card operations worldwide, according to widely cited industry estimates.
History & Origins
In 1959, a committee of computer manufacturers, government agencies, and users formed CODASYL (Conference on Data Systems Languages) to create a common business language. Grace Hopper, who had pioneered the concept of machine-independent programming languages with FLOW-MATIC, served as a key technical consultant to the committee. COBOL was designed with revolutionary goals:
- English-like readability - Code should read like business documentation
- Machine independence - Write once, run anywhere (decades before Java)
- Self-documenting - Programs should explain themselves to non-programmers
- Data processing focus - Designed for business record-keeping, not scientific calculation
The Name Behind the Language
The CODASYL committee insisted that COBOL be readable by business managers, not just programmers. This philosophy, championed by Grace Hopper, shaped every aspect of the language: verbose keywords (ADD, SUBTRACT, MULTIPLY), sentence-like syntax, and extensive commenting capabilities.
Why COBOL Still Matters
Despite being 65+ years old, COBOL remains mission-critical:
1. Massive Economic Impact
- Hundreds of billions of lines of COBOL code reportedly in production worldwide (a 2022 Micro Focus survey estimated over 800 billion)
- Industry estimates suggest approximately $3 trillion in daily commerce processed by COBOL systems
- A widely cited figure claims 95% of ATM transactions rely on COBOL backends, though the original methodology is unverified
- According to Reuters (2020), approximately 80% of in-person financial transactions touch COBOL code
2. If It Works, Don’t Fix It
Rewriting COBOL systems is extraordinarily risky:
- Decades of accumulated business rules embedded in code
- Mission-critical operations that can’t tolerate downtime
- Cost of rewriting often exceeds hundreds of millions of dollars
- Risk of introducing bugs in financial calculations
3. Modern COBOL Features
COBOL 2014/2023 is not your grandfather’s COBOL:
- Object-oriented programming (classes, inheritance)
- XML processing (standard); JSON support (vendor extensions)
- Dynamic-capacity tables
- Integration with Java and .NET
- Unicode and internationalization support
- Web services and RESTful APIs (via vendor implementations)
The COBOL Structure
COBOL programs are organized into divisions that mirror business documentation:
| |
The Four Divisions
- IDENTIFICATION DIVISION - Program metadata (name, author, date)
- ENVIRONMENT DIVISION - Hardware and file configuration
- DATA DIVISION - All data structures and variables
- PROCEDURE DIVISION - The actual program logic
This rigid structure enforces organization and makes programs easy to navigate even decades after they were written.
COBOL’s Verbose Beauty
What looks like verbosity is actually precision:
| |
Every statement reads like a business rule. Non-programmers can understand what the code does, making maintenance easier across generations of developers.
Modern COBOL Compilers
Several compilers keep COBOL alive:
| Compiler | Vendor | Platforms | Notes |
|---|---|---|---|
| GnuCOBOL | Open Source | All | Free, COBOL 85/2002/2014 support |
| IBM Enterprise COBOL | IBM | z/OS, Linux | Mainframe standard |
| Micro Focus COBOL | Rocket Software (formerly Micro Focus) | All | Leading commercial compiler |
| ACUCOBOL-GT | Rocket Software (formerly Micro Focus) | All | Cross-platform runtime |
| Fujitsu NetCOBOL | Fujitsu | Windows, Linux | Enterprise COBOL compiler |
For this tutorial series, we’ll use GnuCOBOL (formerly OpenCOBOL), which is free, open-source, and produces native executables (via C translation).
Getting Started
COBOL code is typically stored in files with extensions:
.cob,.cbl- Standard COBOL source.cpy- Copybooks (shared code/data definitions)
The typical workflow with GnuCOBOL:
| |
The -free flag enables free-format source (no column restrictions), while -x creates an executable.
The Y2K Legacy
The year 2000 problem thrust COBOL into public consciousness. When programmers in the 1960s-70s used 2-digit years to save memory, they created a ticking time bomb. The worldwide effort to fix billions of lines of COBOL code:
- Cost an estimated $300-600 billion globally according to Gartner
- Created massive demand for COBOL programmers
- Proved COBOL’s continued importance
- Highlighted the risks of technical debt
Many “temporary” patches applied during Y2K remain in production today.
The COBOL Skills Gap
As original COBOL programmers retire, organizations face a crisis:
- Industry surveys suggest the average COBOL programmer is between 45-58 years old
- University CS programs rarely teach COBOL
- Mainframe knowledge becoming rare
- Critical systems at risk without maintainers
This creates opportunities: COBOL programmers command premium salaries, and initiatives like IBM’s Open Mainframe Project COBOL training program aim to attract new talent to the language.
Modern Integration
Contemporary COBOL isn’t isolated:
- Java interoperability - Call Java from COBOL and vice versa
- Web services - COBOL programs expose REST/SOAP APIs
- Databases - Seamless integration with DB2, Oracle, PostgreSQL
- Cloud deployment - Mainframe applications moving to cloud platforms
- Container orchestration - COBOL microservices in Kubernetes
Continue to the Hello World tutorial to write your first COBOL program.
Timeline
Notable Uses & Legacy
Banking Systems
According to widely cited industry estimates, the majority of ATM and credit card transaction processing worldwide reportedly runs on COBOL code written decades ago.
Government Benefits
The Social Security Administration maintains over 60 million lines of COBOL code, processing over $1 trillion in annual payments to approximately 70 million beneficiaries.
Insurance Industry
Major insurance companies process claims and manage policies with COBOL applications containing millions of lines of code.
Airline Reservations
Legacy airline booking systems still rely on COBOL for their core transaction processing and inventory management.
Healthcare Claims
Medicare and Medicaid process nearly $2 trillion combined in annual healthcare spending. CMS has historically relied on legacy COBOL mainframe systems for claims processing, though active modernization efforts are underway.
Retail Point-of-Sale
Major retailers' backend systems for inventory, pricing, and transaction processing still depend on COBOL.
Language Influence
Influenced By
Influenced
Running Today
Run examples using the official Docker image:
docker pull esolang/cobol:latestExample usage:
docker run --rm -v $(pwd):/app -w /app esolang/cobol sh -c 'cobc -x -free hello.cob && ./hello'