Example: The section trailers for an accounts receivable report sectioned by data group (AAA, BBB, etc.) are to contain six edited numeric values for a 6-byte field that begins at byte 8 (8,6). The values to be printed are the following:
-
The minimum data value up to that point in the report (SUBMIN)
-
The minimum data value in the section (MIN)
-
The maximum data value up to that point in the report (SUBMAX)
-
The maximum data value in the section (MAX)
-
The average data value up to that point in the report (SUBAVG)
-
The average data value in the section (AVG)
Each value will be preceded, on the same line, by appropriate identifying text. Two columns of data will be printed.
To print the report, the following is coded:
The following shows two sections from the report, with the resulting values for subminimums, minimums, submaximums, maximums, subaverages and averages:
Explanation: The SECTION parameter generates a section break on field 1,3, which identifies data groups (AAA, BBB, etc.). The HEADER3 parameter defines section headers that print the label "GROUP" followed by the data group identifier. HEADER3 also defines two column headings: "SECTION," which identifies the column containing section numbers, and "VALUE," which identifies the columns containing the numeric data.
The TRAILER3 subparameters are SUBMIN, MIN, SUBMAX, MAX, SUBAVG and AVG. They specify the six values to appear in the section trailer. The values are all derived from the same field (8,6) and are suitably edited with mask M2 (8,6,ZD,M2).
The OUTREC parameter places the two data fields (5,2 and 8,6) in the report and edits the 8,6 field in the same way as for the six values in the section trailer (8,6,ZD,M2). The blank space placed at position 80 (80:1X) ensures that the output record is long enough to contain the header records.