COBOL

acronym

programming

Kept in this browser · My desk

Stands for: Common Business-Oriented Language

The Common Business-Oriented Language, specified in 1959 to 1960 by the Conference on Data Systems Languages (CODASYL) committee for the United States Department of Defense and manufacturers, for business data processing.

The Initial Specifications were published by the Department of Defense in April 1960; Hopper's FLOW-MATIC, the only business language then existing, provided its foundations.

What it is. COBOL, the Common Business-Oriented Language, was designed in 1959 for business data processing: programs meant to read almost like English, to run on rival manufacturers' machines, and to describe files and records in a section of their own. It was specified by the Conference on Data Systems Languages (CODASYL), a committee of users and manufacturers working under the sponsorship of the United States Department of Defense (DoD), which published the Initial Specifications in April 1960.

Who designed it. Many people did, and the record names them carefully. Jean Sammet, in the pioneer biographies of the Institute of Electrical and Electronics Engineers (IEEE) Computer Society, was a member of the CODASYL COBOL committee and chair of its Short Range Subcommittee, "which developed all the statements of the language", and a key member of the group that "first developed Cobol in 1959", chairing the Statement Language Task Group and the Editing Committee. Grace Hopper's FLOW-MATIC, the only business language then existing, provided the foundations, as MacTutor puts it. Yale's account of Hopper says that "although many people contributed to the 'invention' of COBOL, Hopper promoted the language and its adoption by both military and private-sector users", led efforts throughout the 1960s to develop COBOL compilers, and quotes her biographer Kurt Beyer calling her "the person most responsible for the success of COBOL during the 1960s". When she retired as a rear admiral at 79, Yale adds, she was the oldest serving officer in the United States armed forces.

How a program is built. A COBOL source program is grouped into four divisions, as IBM's Enterprise COBOL for z/OS 6.3 Language Reference (SC27-8713-02, 31 May 2024 update) still lists them: IDENTIFICATION DIVISION, ENVIRONMENT DIVISION, DATA DIVISION and PROCEDURE DIVISION. The data division describes every record field by its picture and its usage, and the procedure division manipulates them with verbs such as MOVE, ADD and COMPUTE.

Decimal by design. Business arithmetic is decimal, and COBOL makes the storage of numbers explicit. IBM's reference lists the usages: DISPLAY for zoned decimal; PACKED-DECIMAL or COMP-3 for internal decimal; BINARY, COMP, COMP-4 and COMP-5 for binary integers; COMP-1 and COMP-2 for floating point. Money held in decimal avoids the rounding surprises of binary fractions, which is one reason banks kept COBOL.

A record, field by field. A data division entry such as 05 BALANCE PIC S9(7)V99 COMP-3 says almost everything about a value: a signed number (S) of seven integer digits and two decimal digits, with an assumed decimal point (V), which IBM's reference describes as one that "has logical meaning but that does not exist as an actual character in the data", stored as internal decimal. The precision belongs to the declaration rather than to the arithmetic, and the rules for moving data follow from it: when a value is moved into a numeric item, "the data is aligned on the assumed decimal point and, if necessary, truncated or padded with zeros".

Standards. COBOL has been an international standard since the 1980s. The working group for COBOL of the International Organization for Standardization (ISO) and the International Electrotechnical Commission (IEC), JTC1/SC22/WG4, lists ISO 1989:1985, an intrinsic-function amendment of 1992 and a correction amendment of 1994; the current standard is ISO/IEC 1989:2023, edition 3, published in January 2023, with a replacement draft expected.

Where it shows up. A great deal of banking, insurance and government code still runs in COBOL, much of it on IBM mainframes under z/OS, where Enterprise COBOL is maintained and extended with support for UTF-8 data and JSON among other features.

What goes wrong. The risks are those of long-lived code: a MOVE into a field that is too small, which loses the high-order digits without an error, exactly as the alignment rule says; data whose layout is defined by pictures and usages that other systems must reproduce exactly, so that a COMP-3 field read as text produces nonsense; records with fixed widths that do not fit new data; and programs older than the people who maintain them. COBOL's English-like surface also misleads; its rules about truncation, rounding and signs are precise and must be read in the reference, not guessed.

Neighbours. COBOL is the business sibling of FORTRAN, the work of a committee in which Grace Hopper and Jean Sammet stand out, and one of the oldest programming languages still standardized and in production. Brazilian practice says COBOL.

Also known as: common business oriented language, cobol 2023

Sources

← Back to C Back to the glossary