COBOLbeginner
Condition Names (88-Levels)
Use 88-level condition names to give meaningful names to specific values of a data item and write self-documenting conditional logic.
Level-88 items, called condition names, let you attach a meaningful name to one or more specific values of a parent data item, so instead of writing IF WS-STATUS = 'A' scattered throughout a program, you write IF WS-ACTIVE — dramatically improving readability and reducing the chance of a typo'd literal causing a silent logic bug.
An 88-level is like a labeled light switch position — instead of remembering that flipping the breaker to 'position 3' means the porch light is on, you flip a switch labeled PORCH-LIGHT-ON, and the wiring detail is hidden behind that name.
Key Concepts
1
An 88-level isn't a storage item itself; it occupies no space and simply defines a boolean-like test tied to its parent field's value. 88 WS-ACTIVE VALUE 'A' means the condition WS-ACTIVE is true exactly when the parent field currently holds 'A'. You can also list multiple values or ranges: 88 WS-VALID-STATUS VALUES 'A' 'P' 'S' or 88 WS-VALID-RANGE VALUES 1 THRU 100.
88 WS-ACTIVE VALUE 'A'88 WS-VALID-STATUS VALUES 'A' 'P' 'S'88 WS-VALID-RANGE VALUES 1 THRU 100
2
Critically, you can also SET a condition name directly — SET WS-ACTIVE TO TRUE moves the literal value 'A' into the parent field, which is both more readable and safer than a MOVE, because the mapping between the condition name and its underlying value lives in one place (the DATA DIVISION) rather than being repeated as magic literals throughout the PROCEDURE DIVISION.
SET WS-ACTIVE TO TRUE
3
Interviewers value this topic because it's cheap to explain but reveals whether a candidate writes maintainable COBOL or copies whatever pattern they last saw — and because reading 88-levels correctly is essential to understanding almost any nontrivial legacy program's control flow, since production code is dense with them.