PIC Clauses
- PIC. The PIC clause draws a field’s shape: 9 for digits, X for characters, V for the implied decimal point.
- Numeric pictures. PIC 9(7)V99 is seven digits and two decimals: money declared to the penny.
- Edited pictures. Edited pictures format output: Z suppressing zeros, commas and signs drawn in the picture.
Numeric and Character Data
- DISPLAY and COMP. Numeric USAGE matters: DISPLAY stores digits as characters, COMP-3 packs decimals tight.
- MOVE semantics. MOVE copies by picture: truncating and padding by the target’s shape, silently.
- Signs and zones. Signed fields carry the sign in zones: the reason a mainframe file shows letters in amounts.
Records and Fields
- Record layouts. A record layout is the file’s contract: every byte positioned by the data division.
- REDEFINES. REDEFINES overlays one layout on another: the same bytes read two ways, deliberately.
- 88 levels. 88-level condition names give flags readable names: IF ACCOUNT-CLOSED beats IF STATUS = "C".
Before and after this level
- Before: Level 1: COBOL Program Structure: Identification and Environment Divisions, Data Division, Procedure Division.
- Next: Level 3: Program Logic: Conditions, PERFORM, Business Processing Flow.
In the app each of these ideas is taught and then asked back, and the level ends with a checkpoint and flashcards. See Checkpoints and flashcards.
Frequently asked questions
What does COBOL Level 2: Data Definitions cover?
PIC Clauses, Numeric and Character Data, Records and Fields: 3 lessons and 9 ideas.
What should I know before this level?
The level before it, Level 1: COBOL Program Structure, which covers Identification and Environment Divisions, Data Division, Procedure Division.