The sorted extract file records provide the input for control breaks and printing the report.
The only fields from the extract record used in the type 8 logic or on the type 6 lines are those that are coded on the SORT parameter or on the type 5 lines. Work fields that are not part of the extract record are also available for use.
Type 8 logic is executed whenever a control break is encountered on STATUS or DEPARTMENT.
The TAKE after sequence 400 sends the type 6 line to be printed.
One subtotal accumulator (bucket) is set up for each field at each break level for numeric fields named on type 5 lines and referenced in type 8 logic or on type 6 parameters (AGE and EMPLOYEE-COUNT). No other fields are automatically subtotaled.
There are three control break levels:
LEVL 1 - STATUS
LEVL 2 - DEPARTMENT
LEVL 3 - GRAND TOTAL
AGE and EMPLOYEE-COUNT are defined as work fields, and used as such in type 7 logic., are not used In type 8 logic, AGE and EMPLOYEE-COUNT are not used as work fields because they are part of the extract file record in the output processing phase. (Note that AVERAGE-AGE could be used as a work field in both type 7 and type 8 logic because it is not part of the extract record.)