Writing a summary or trailer for a report will sometimes involve providing totals for columns of figures. For example, you would probably want a trailer for an inventory report to contain the total number of items on hand. The OUTFIL statement allows you to write trailers that contain both totals and subtotals. Moreover, you can total data at the end of a report, at the end of a page, and also at the end of a section.
To generated total and subtotals, use the TOTAL and SUBTOTAL entries of OUTFIL’s TRAILER parameters and subparameter. For details of syntax, see TRAILER Parameters (Optional).