Module lessons (1/2)
Hierarchical Records and Group Items
Declare records 01 and subordinate fields 05/10, understand the impact of MOVE on group elements, and format contiguous reports.
What you'll learn in this lesson
- Organize related fields into hierarchical records (
01,05,10,15) with contiguous layout in memory. - Predict the effect of
MOVEon a group element (always treated byte-for-byte as an alphanumeric string). - Safely clear all fields of a mixed text/number record using
INITIALIZEorMOVE CORRESPONDING.
Overview
In COBOL there are no dynamic objects on the heap: all the fields of a record are physically attached in sequence within the area allocated by the 01 level.
An element that has child fields under it is called Group Item and must NOT have the PIC clause: its total length is the sum of the bytes of the elementary fields only (elementary items):
Sections covered in this lesson
- 11. Level Hierarchy (
01/05/10) - 22. The
MOVEtrick (and risk!) on Group Items - 33. Safe clean with
INITIALIZEand copy withCORRESPONDING - 44.
FILLERfor separators and fixed columns - 5Try it yourself
Unlock "Hierarchical Records and Group Items" and the full Course COBOL curriculum
Declare records 01 and subordinate fields 05/10, understand the impact of MOVE on group elements, and format contiguous reports.
Unlock all 5 hands-on exercises in this lesson plus every advanced WebAssembly module with automated checks.
- Instant access to all advanced modules in Course COBOL plus 17 more courses
- Hands-on browser exercises with automated test suites and solutions
- 14-day money-back guarantee processed via Paddle.com
14-day guarantee · Cancel anytimeModule 1, all 18 interactive games, and cheatsheets are always free.