Data Division, PIC Clauses, Level Numbers, and Record Modeling
Understand how COBOL represents business data using explicit field definitions and hierarchical record layouts.
Inside this chapter
- Why Data Definitions Are Central in COBOL
- Level Numbers
- PIC Clauses
- Why This Explicitness Matters
- Real Example
Series navigation
Study the chapters in order for the clearest path from COBOL basics to enterprise batch processing, operational context, and modernization strategy. Use the navigation at the bottom to move smoothly through the full tutorial series.
Why Data Definitions Are Central in COBOL
COBOL programs often revolve around well-defined business records such as customer accounts, payroll entries, invoice lines, transaction batches, and report totals. Because of that, the DATA DIVISION is one of the most important parts of the language.
Level Numbers
01 CUSTOMER-RECORD.
05 CUSTOMER-ID PIC 9(6).
05 CUSTOMER-NAME PIC X(30).
05 CUSTOMER-BALANCE PIC 9(7)V99.
Level numbers express hierarchy in record definitions. This lets COBOL represent structured business data cleanly and explicitly.
PIC Clauses
The PIC, or picture clause, describes the shape of the data. X is commonly used for character fields, while 9 is used for numeric fields. Decimal handling, signs, formatting, and field width are all encoded explicitly in data definitions.
Why This Explicitness Matters
Financial and administrative systems often rely on exact field definitions. Knowing whether a field is six digits, thirty characters, or a decimal amount with two implied places is critical for file compatibility, reporting, and integration with other systems.
Real Example
An insurance claim record may include policy ID, claimant name, claim amount, claim date, and status code. COBOL’s record model makes the structure of such business data highly visible and stable over time.