COBOL
Common Business-Oriented Language
- Pronunciation
- KOH-bol
In short
COBOL (Common Business-Oriented Language) is a language from 1959 for business data processing that still runs critical banking and government systems.
What is COBOL?
COBOL was designed in 1959 by a committee of industry and US government experts, drawing heavily on Grace Hopper's earlier FLOW-MATIC language. The goal was a language for business records that managers could almost read, with statements such as ADD TAX TO PRICE GIVING TOTAL and programs that could run on computers from different makers.
A COBOL program is split into four divisions: identification, environment, data and procedure. The data division describes records field by field with exact sizes and decimal formats, which makes COBOL very good at precise money arithmetic and processing large batches of fixed-format records, the classic job of banks, payroll and tax systems.
A large amount of COBOL code still runs today, mostly on IBM mainframes, handling account transactions, card payments, insurance claims and government benefits. It has been updated over time, with standards adding object orientation and other modern features, and it can be called from Java and connected to web APIs.
A common misconception is that COBOL is dead. The systems written in it are reliable, enormous and risky to replace, so organizations keep maintaining them, and experienced COBOL developers are scarce and in demand. Many modernization projects wrap COBOL programs in APIs or migrate them gradually rather than rewriting everything at once.
Key takeaways
- COBOL is a business programming language from 1959.
- Its English-like syntax was meant to be readable by non-programmers.
- Programs have identification, environment, data and procedure divisions.
- It excels at exact decimal arithmetic and batch record processing.
- Much banking and government software still runs on COBOL mainframes.
Example
IDENTIFICATION DIVISION.
PROGRAM-ID. INVOICE.
DATA DIVISION.
WORKING-STORAGE SECTION.
01 PRICE PIC 9(5)V99 VALUE 120.50.
01 TAX PIC 9(5)V99 VALUE 24.10.
01 TOTAL PIC 9(6)V99.
01 TOTAL-OUT PIC ZZZ,ZZ9.99.
PROCEDURE DIVISION.
ADD PRICE TO TAX GIVING TOTAL.
MOVE TOTAL TO TOTAL-OUT.
DISPLAY "Invoice total: " TOTAL-OUT.
STOP RUN.Readers ask
Is COBOL still used?
Yes. Banks, insurers, airlines and governments still run core systems written in COBOL, mostly on mainframes, and those systems process a large share of everyday financial transactions.
Is it worth learning COBOL?
It can be a niche but valuable skill, since experienced COBOL developers are in short supply. It makes most sense for people interested in mainframes, banking or modernization projects.
Why hasn't COBOL been replaced?
The programs are large, reliable and full of business rules built up over decades. Rewriting them is expensive and risky, so organizations usually maintain them or modernize them step by step.
See also
- FortranProgramming Languages, p. 12Fortran is the first widely used high-level language, created at IBM in 1957 for science and engineering and still used in high-performance computing.
- JavaProgramming Languages, p. 15Java is a statically typed, object-oriented programming language that compiles to bytecode for the Java Virtual Machine, so programs run on many platforms.
- CompilerProgramming Fundamentals, p. 11A compiler is a program that translates source code written in a programming language into a lower-level form, such as machine code, that a computer can run.
- Data TypeProgramming Fundamentals, p. 14A data type is a classification that tells a program what kind of value a piece of data holds, such as a number or text, and which operations work on it.
- Technical DebtSoftware Architecture, p. 45Technical debt is the future cost of extra work created when developers choose a quick or limited solution now instead of a better approach that takes longer.
Spotted a mistake or something missing on this page?Suggest an edit