Today we would code the program to loop through the required records, accumulate totals, detect breaks
in the break we would print summary lines roll totals to next level and set current level to zero.
The O specs for each level of the break would be pretty straignt forward
Each O record would have a name — (CoTotLn, DivTotLna) and spacing before/after
Each field would have a name DivTotSls, DivTotCst field size, decimals, edit codes and ending position on the page.
Hope that gets you started.