3 accumulating and reporting totals – Compaq COBOL AAQ2G1FTK User Manual

Page 304

Advertising
background image

Producing Printed Reports
10.2 Components of a Report

3

Control Heading (CH)—The control heading consists of one or more lines of
information identifying the beginning of a new logical area on a page.

4

Detail Lines (DL)—The detail (the lines marked with 4 and all the lines
between) consists of one or more lines of the primary data of the report.

5

Control Footing (CF)—The control footing (the line marked with 5 and the
following line) consists of one or more lines of information identifying the end
of a logical area. The control footing can contain one or more totals and an
accompanying message.

6

Page Footing (PF)—The page footing (the lines marked with 6 and all the
lines between) consists of one or more lines of information at the bottom of
each page.

7

Report Footing (RF)—The report footing (the lines marked with 7 and all
the lines between) consists of information printed after the main body of the
report. It can be continued on the same page of the report body, or it can be
on a separate page. It may contain information such as hash or control totals.
A report footing is a convenient place to print run-time statistics, such as the
number of records read and written for each file. It can also provide warning
messages, such as when a table is close to overflowing.

It is suggested that all reports have an END OF REPORT message or other
indicator at the end of the report, so that you can tell at a glance that you
have all the pages. (The consecutive page numbers tell if a page is missing,
but they do not indicate which page is the last.)

10.3 Accumulating and Reporting Totals

Your program can report three types of totals in the control footings and report
footings of your report:

Subtotals—Subtotaling is the process of summing a detail item from each
detail line. For example, in Figure 10–2, Salary, Bonus, and Total Sales are
subtotaled. To get the first salary subtotal for January on page 1 ($75,000.00),
the program must add each salesman’s salary ($30,000+$25,000+$20,000).
After printing the salary total, the program must zero the total to begin
subtotaling for the next month.

Crossfoot Totals—Crossfooting is the process of summing subtotals from
a common group of totals. For example, in Figure 10–2, TOTAL SALARY
EXPENSE is crossfooted by adding TOTAL SALARY and TOTAL BONUS.
To get the first TOTAL SALARY EXPENSE crossfoot total for the January
report, the program must add the salary subtotal and the bonus subtotal
before the program clears the subtotals.

Rolled Forward Totals—Rolling-forward is the process of summing either
subtotals or crossfoot totals. For example, in Figure 10–2, the YEAR TO
DATE TOTALS at the bottom of page 1 are rolled forward from both the
JANUARY and FEBRUARY totals. The program computes the salary
and bonus YEAR TO DATE TOTALS from the previous salary and bonus
subtotals. It computes the total salary expense figure from the previous total
salary expense crossfoot totals.

10–4 Producing Printed Reports

Advertising