Skip to content
COBOL

DATA DIVISION

The part of a COBOL program that declares every record layout and variable it will use.

Also written DATA DIVISION, file section

The DATA DIVISION is where a COBOL program describes its data before using any of it. Nothing is declared on the fly; everything the program touches is laid out here first.

It has two main sections. FILE SECTION describes the records of each file the program reads or writes, giving the exact layout of every field. WORKING-STORAGE SECTION declares the variables the program uses internally: counters, totals, flags, work areas and constants.

Each item is declared with a level number showing how it nests, a name, and a picture clause saying what kind of data it holds and how long it is. Group items contain other items, so a customer record can be declared as a structure of fields, which is precisely how business records are shaped.

In real programs this division is often longer than the logic that follows it, and that is normal. Much of understanding an unfamiliar COBOL program comes from reading its DATA DIVISION carefully first, because the record layouts tell you what the program is actually about.

Browse all 115 terms

Learn this properly.

Use DATA DIVISION for real in Mainframe101, in your browser, with Zed beside you. Join the waitlist.

Early access and updates. No spam, unsubscribe any time.