Sequential Files
- Sequential processing. A sequential file reads start to end: the shape of statements, extracts and feeds.
- OPEN, READ, WRITE, CLOSE. File verbs are explicit: OPEN INPUT, READ with AT END, WRITE, CLOSE: lifecycle spelled out.
- End-of-file handling. The AT END clause handles exhaustion: the read-ahead pattern every batch loop uses.
Indexed Files
- Indexed files. An indexed (VSAM-style) file reads by key: READ with KEY, START for ranges.
- Random and dynamic access. ACCESS DYNAMIC mixes sequential sweeps with keyed lookups: master-file maintenance’s mode.
- File status. Every operation sets FILE STATUS: checked after each verb, or failures pass silently.
File Processing
- Master-transaction updates. The classic pattern: sorted transactions applied against a master file: matched by key, balanced by totals.
- Control totals. Control totals reconcile every run: records in, records out, money balanced to the penny.
- Restart thinking. Long jobs design for restart: checkpoints and reruns that never double-post.
Before and after this level
- Before: Level 4: Tables & Records: Tables, OCCURS, Structured Business Records.
- Next: Level 6: Programs & Reuse: Subprograms, COPYBOOKS, Shared Business Definitions.
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 5: Files cover?
Sequential Files, Indexed Files, File Processing: 3 lessons and 9 ideas.
What should I know before this level?
The level before it, Level 4: Tables & Records, which covers Tables, OCCURS, Structured Business Records.