COBOL
The business programming language that still runs the world - powering banking, government, and enterprise systems for over 60 years.
Created by Grace Hopper and the CODASYL Committee
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 continues to process an estimated 95% of ATM transactions and the majority of credit card operations worldwide.
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. Led by Grace Hopper, who had pioneered the concept of machine-independent programming languages with FLOW-MATIC, the committee designed COBOL 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
Grace Hopper insisted that COBOL be readable by business managers, not just programmers. This philosophy 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
- 220 billion lines of COBOL code in production worldwide
- $3 trillion in daily commerce processed by COBOL systems
- 95% of ATM transactions rely on COBOL backends
- 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)
- JSON and XML processing
- Dynamic tables and memory allocation
- Integration with Java and .NET
- Unicode and internationalization support
- Web services and RESTful APIs
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 | Micro Focus | All | Leading commercial compiler |
| ACUCOBOL-GT | Micro Focus | All | Cross-platform runtime |
| Fujitsu NetCOBOL | Fujitsu | Windows, Linux | Japanese market leader |
For this tutorial series, we’ll use GnuCOBOL (formerly OpenCOBOL), which is free, open-source, and produces native executables.
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 billion globally
- 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:
- Average COBOL programmer age is 55+
- 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 “Call for Code” 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
95% of ATM transactions and the majority of credit card processing worldwide run on COBOL code written decades ago.
Government Benefits
Social Security Administration processes billions in payments using COBOL systems managing over 60 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 systems process over a trillion dollars in annual claims through COBOL-based infrastructure.
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'