Skip to content
Tutorials Center
My learning

Topics

Lesson 20 of 38 ยท Getting Started

What Is COBOL and Why Does It Still Matter?

Learn what COBOL is, where it came from, why banks, insurers and governments still run on it, and what a modern COBOL developer actually does.

COBOL stands for COmmon Business-Oriented Language. It was designed in 1959 for one job: processing business records such as payroll, invoices, bank accounts and insurance policies. Its commands read like short English sentences (ADD PRICE TO TOTAL, MOVE ZERO TO COUNTER), and it was built so that people who were not computer scientists, such as auditors and managers, could follow what a program does.

More than sixty years later COBOL is still running. Card payments, ATM withdrawals, pension payments, airline bookings and tax systems pass through COBOL programs every day. Nobody has to like that fact for it to be useful to you: it means COBOL skills are rare, valued and often well paid.

A short history

Year Event
1959 A committee called CODASYL starts designing a common business language. Grace Hopper's FLOW-MATIC is a major influence.
1960 The first COBOL specification and the first programs on two different makes of computer.
1968, 1974 The first ANSI standards.
1985 COBOL-85 adds structured statements such as END-IF, EVALUATE and inline PERFORM. Most code you will meet was written to this standard.
2002 Object-oriented COBOL, free-format source, Unicode support, intrinsic functions grow.
2014, 2023 Further revisions (floating-point, dynamic tables, more functions).

COBOL grew by adding features while keeping old programs working. A program written in 1975 can often still compile today. That backward compatibility is the biggest reason the language is still alive.

What COBOL is good at

COBOL is not a general-purpose language for games or web pages. It is built for batch and transaction processing of large volumes of record-shaped data:

  • Exact decimal arithmetic. A COBOL number is a fixed number of decimal digits, so 0.10 + 0.20 is exactly 0.30. Floating-point languages cannot promise that.
  • Fixed-width records. A customer record is a known number of bytes: 30 for the name, 10 for the account number and so on. COBOL describes such layouts directly.
  • Files. Sequential, indexed and relative files are part of the language itself, not a library.
  • Readability and stability. Code is verbose on purpose, and programs run for decades.
  • Throughput. On a mainframe, COBOL batch jobs process millions of records per night.
Python Why exact decimals matter (Python stand-in)

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

For money, a drifting last digit is a bug. COBOL avoids the problem by design, as you will see in picture clauses and usage and value.

COBOL also describes data as fixed-width records, the way files looked on punched cards and tapes. The next stand-in reads one such record by position:

Python A fixed-width record (Python stand-in)

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

Where COBOL lives

Where COBOL runs today

Banking Accounts, ledgers, cards
Insurance Policies and claims
Government Tax, pensions, benefits
Travel Reservations, freight

Large batch and transaction workloads

1 / 2

The typical environment is an IBM mainframe (z/OS) with CICS for online transactions, JCL for batch jobs and Db2 or VSAM for data. Smaller shops run COBOL on Linux or Windows with compilers such as Micro Focus Visual COBOL or the free GnuCOBOL, which this course uses. See Modern COBOL and Mainframes later for the mainframe side.

The style of the language

A tiny example, shown read-only because this site cannot run COBOL:

COBOL
       IDENTIFICATION DIVISION.
       PROGRAM-ID. TOTALS.
       DATA DIVISION.
       WORKING-STORAGE SECTION.
       01 PRICE   PIC 9(3)V99 VALUE 19.99.
       01 QTY     PIC 9(2)    VALUE 3.
       01 TOTAL   PIC 9(5)V99.
       PROCEDURE DIVISION.
           MULTIPLY PRICE BY QTY GIVING TOTAL
           DISPLAY "Total: " TOTAL
           STOP RUN.

Even without knowing the language you can guess what it does. It prints Total: 0005997 (the numeric field is shown with its implied digits, no decimal point; you will learn why in picture clauses).

Common myths

  • "COBOL is dead." The language is old, not dead: new COBOL is still written, and the compilers are still developed.
  • "COBOL is easy because it reads like English." The words are simple but the programs are big, the data layouts are unforgiving and the surrounding system (JCL, CICS, files) takes time to learn.
  • "Nobody will ever hire a COBOL programmer." Many organisations struggle to find them.

How this course works

You will learn the four divisions, data description, control flow, data handling, tables, files, subprograms and the mainframe environment, then build projects. Examples are shown as read-only COBOL source, because there is no COBOL compiler in the browser. Where a behaviour can be demonstrated, a runnable Python stand-in, clearly labelled, models it. To run the real thing, install GnuCOBOL in the next lesson.

Check your understanding

Quick check ยท 4 questions

of 4 answered You scored / 4 ยท perfect!

  1. 1. What does COBOL stand for?

    COBOL is the Common Business-Oriented Language, designed in 1959 for business data processing.
  2. 2. Which feature makes COBOL well suited to money calculations?

    COBOL numbers are declared with a fixed number of decimal digits, so values like 0.10 + 0.20 are exact.
  3. 3. Which standard introduced END-IF, EVALUATE and inline PERFORM?

    COBOL-85 added the structured, scope-terminated statements most modern code uses.
  4. 4. Why does 60-year-old COBOL still compile today?

    Each standard added features while keeping older programs working.

Summary

  • COBOL (1959) is a business language built for records, files and exact decimal arithmetic.
  • It runs much of the world's banking, insurance and government batch and transaction work.
  • COBOL-85 introduced the structured statements still used today; later standards added objects and free format.
  • Typical work is maintaining, testing, integrating and modernising existing programs.
  • This course uses GnuCOBOL, read-only listings and labelled Python stand-ins.

Next: Hello, World with GnuCOBOL