Tables
- OCCURS basics. A table declares with OCCURS: twelve monthly buckets as one named structure.
- Indexing tables. Tables index with subscripts or INDEXED BY: SET and SEARCH working with indexes.
- SEARCH. SEARCH scans a table and SEARCH ALL binary-searches a sorted one: lookup verbs built in.
OCCURS
- OCCURS DEPENDING ON. DEPENDING ON makes variable-length records: the count field governing the real occurrences.
- Multi-dimensional tables. OCCURS nests: regions by months by products: subscripts per dimension.
- Bounds discipline. Subscript overruns corrupt neighbouring storage: bounds checked by code and compiler options.
Structured Business Records
- Group moves. Group-level MOVE copies whole structures: layouts must correspond, or bytes land wrong.
- Redefines for variants. Record variants: header versus detail: share layouts through REDEFINES and type fields.
- Copy the layout once. Shared layouts live in copybooks: one definition, every program in agreement.
Before and after this level
- Before: Level 3: Program Logic: Conditions, PERFORM, Business Processing Flow.
- Next: Level 5: Files: Sequential Files, Indexed Files, File Processing.
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 4: Tables & Records cover?
Tables, OCCURS, Structured Business Records: 3 lessons and 9 ideas.
What should I know before this level?
The level before it, Level 3: Program Logic, which covers Conditions, PERFORM, Business Processing Flow.