Menu
CoddyTech

What Is COBOL?

COBOL (COmmon Business-Oriented Language) is a programming language designed in 1959 for business data such as records, money and reports. Its code reads like English, and banks, insurers and governments still run large COBOL systems for accounts, payments and payroll, mostly on IBM mainframes.

By Kevin Spektor, Co-founder & CTO

Updated November 25, 2026

This is a complete COBOL program. Press Run: GnuCOBOL compiles it and runs it, and the line it prints appears under the code.

Hello from COBOL!

COBOL reads close to English on purpose. DISPLAY prints, STOP RUN ends the program, and each sentence ends with a period. Its designers wanted people who were not programmers, such as managers, to be able to follow what a business program does.

What COBOL stands for

COBOL stands for COmmon Business-Oriented Language. CODASYL, a committee of US government and industry experts, designed it in 1959 for business data: customer records, money and printed reports. Grace Hopper's earlier language FLOW-MATIC was one of its main influences, and the reason COBOL statements are English words.

"Common" meant one language for computers from different makers, at a time when each maker had its own. COBOL is still a standard that keeps changing: COBOL-85 added structured statements such as END-IF and EVALUATE, COBOL 2002 added object-oriented programming, and newer standards came out in 2014 and 2023.

How a COBOL program is laid out

A COBOL program is split into four divisions, always in this order:

  • IDENTIFICATION DIVISION names the program (PROGRAM-ID. HELLO.).
  • ENVIRONMENT DIVISION connects the program to files and devices. The program above uses none, so it leaves this division out.
  • DATA DIVISION declares every piece of data before it is used, with its exact size.
  • PROCEDURE DIVISION holds the statements that run, from top to bottom.

The spaces at the start of each line matter. Classic COBOL is written in fixed format, a layout that comes from 80-column punched cards. Columns 1 to 6 held sequence numbers, a * in column 7 makes the line a comment, division and paragraph names start in column 8, statements start in column 12, and the compiler reads nothing after column 72. Mainframe COBOL is still written in this layout, and so are the programs on this page.

Data with an exact size

In most languages a number is just a number. In COBOL you say how many digits it has, with a PICTURE clause (PIC). This program multiplies a price by a quantity and prints the total twice:

Total:    $59.97
Raw:   0005997
  • PIC 9(3)V99 is a number with three digits before the decimal point and two after it. The V marks where the point goes, but it is not stored: 19.99 is kept as the five digits 01999.
  • MULTIPLY WS-PRICE BY WS-QTY GIVING WS-TOTAL reads like the sentence it is. COMPUTE WS-TOTAL = WS-PRICE * WS-QTY does the same with a formula.
  • PIC $$,$$9.99 is an edited picture, made for printing. It adds the dollar sign and the decimal point, a comma once the amount reaches the thousands, and spaces on the left. Displaying WS-TOTAL itself shows its raw digits, 0005997, with no point at all.

Because these numbers are decimal digits, money adds up to the cent. Many languages store 0.1 and 0.2 as binary fractions, so 0.1 + 0.2 gives 0.30000000000000004 in Python or JavaScript. In COBOL it is exactly 0.30. The cost of an exact size is that a value too big for its field is cut off, with no error:

PIC 99 keeps: 34
0.10 + 0.20 = 0.30 exactly

PIC 99 has room for two digits, so MOVE 1234 keeps the two on the right, 34, and the program goes on. Choosing field sizes that can hold every real value is a large part of writing COBOL.

What COBOL is used for today

COBOL runs the record keeping of large organizations, mostly on IBM mainframes:

  • Banking: accounts, payments, interest and statements.
  • Insurance: policies and claims.
  • Government: benefits, tax and payroll systems.
  • Batch jobs: programs that read a file of records, such as the day's transactions, update a master file and print a report. On a mainframe these run as jobs written in JCL (Job Control Language), which says which programs to run, in what order and with which data.

A COBOL job ad usually asks for JCL too, and often for DB2 (IBM's database), CICS (IBM's system for online transactions) and VSAM (IBM's way of storing records in files).

Is COBOL still used?

Yes. Banks, insurers and governments still run large COBOL systems, and many plan to keep them for years. Rewriting a system that moves money is slow, expensive and risky, and the old code already works, so most organizations change it in place or move it to newer platforms piece by piece.

New projects rarely choose COBOL. Most new business software is written in languages such as Java, C# and Python, and far fewer people learn COBOL than learn those languages. So most COBOL work is keeping existing systems running, changing them and moving parts of them elsewhere. That gap is why COBOL skills are asked for: in Kyndryl's 2025 survey a third of firms reported COBOL and CICS skill gaps. The survey is a vendor's, so treat it as a guide.

Common myths about COBOL

  • "COBOL is a dead language." It has an ISO standard from 2023, compilers that are still updated, such as IBM Enterprise COBOL and the open source GnuCOBOL, and systems that run every day.
  • "You need a mainframe to learn it." GnuCOBOL runs on Linux, Windows and macOS and understands IBM's dialect, so you can write COBOL the way mainframe programs are written. A few things behave differently: a divide by zero without ON SIZE ERROR stops a mainframe program, while GnuCOBOL keeps the old value and goes on.
  • "COBOL code is old, so it is slow." COBOL is compiled to machine code, and IBM mainframe processors have their own instructions for the decimal arithmetic COBOL uses.

Where to go next

Change the programs above in the online COBOL compiler, which runs the same GnuCOBOL. COBOL is a compiled language: read what a compiler is to see what happens between your source and the program that runs, and what machine code is for what it produces. For a language at the other end, where each line is one processor instruction, see assembly language. To learn COBOL from your first DISPLAY to file reports and batch jobs with JCL, take the COBOL course.

Frequently Asked Questions

What does COBOL stand for?

COBOL stands for COmmon Business-Oriented Language. The full form says what it was made for: one language that computers from different makers could share, for business work such as records, money and reports. CODASYL, a committee of US government and industry experts, designed it in 1959.

What is COBOL used for?

Mostly the core systems of banks, insurers and governments: accounts, payments, claims, benefits and payroll. Many of these programs run as batch jobs on IBM mainframes, reading files of records, updating them and printing reports. Others run behind online transactions through IBM's CICS.

Is COBOL still used today?

Yes. Banks, insurers and governments still run large COBOL systems, mostly on IBM mainframes, and many plan to keep them for years. New projects rarely choose COBOL, so most COBOL work is keeping those systems running, changing them and moving parts of them to newer platforms.

Is COBOL hard to learn?

Not the language itself: its statements are English words, and a program spells out every step. What takes practice is its rules: fixed columns, every piece of data declared before use with an exact size, and numbers that are cut off without an error when they do not fit. In a real job, reading large existing programs is the harder part.

Is COBOL worth learning?

It can be, if you want to work at a bank, an insurer, a government agency or an IT services firm that maintains their systems. Job ads usually ask for JCL too, and often DB2, CICS and VSAM. US salary sites such as Glassdoor and ZipRecruiter list COBOL developer pay at roughly $73,000 to $115,000 a year; those are estimates, so treat them as a guide.

Is COBOL compiled or interpreted?
Compiled. A COBOL compiler, such as IBM Enterprise COBOL on a mainframe or the open source GnuCOBOL, turns the source into a program the machine runs. GnuCOBOL does it in two steps: it translates the COBOL into C, then calls a C compiler to produce machine code.
Coddy programming languages illustration

Learn to code with Coddy

Get started