Level number
The two-digit number in front of a COBOL data item that shows how fields nest inside a record.
Also written 01 level, 88 level, group item
Level numbers give COBOL data its structure. Each declared item begins with a number, and the numbers express containment: a higher number nested under a lower one is part of it.
By convention 01 is the top of a record or a standalone item, and subordinate fields are numbered 05, 10, 15 and so on. The increments of five are pure convention, and a useful one, since they leave room to insert a level later without renumbering everything below.
An 01 item that contains other items is a group, and its own value is simply all its parts joined together. That means a whole record can be moved in one statement, or examined field by field, whichever is convenient.
Two special numbers stand apart. 77 declares an independent item with no structure, common in older code. 88 declares a condition name, a readable label for a particular value of the field above it, so a test can be written as a meaningful name rather than a comparison against a code. Condition names make business logic considerably easier to read.
Related terms
- DATA DIVISIONThe part of a COBOL program that declares every record layout and variable it will use.
- PICTURE clauseThe COBOL declaration that says what kind of data a field holds and how long it is, written as PIC.
- WORKING-STORAGEThe section of a COBOL program that declares its internal variables: counters, totals, flags and work areas.
- CopybookA shared block of COBOL declarations kept in a library and included into programs, so a record layout is defined once.
- COBOLThe programming language most business logic on the mainframe is written in. Verbose by design, and still running the world's payments.