Trailers in a report will sometimes require you to obtain a record count or a count for a particular type of item in a specific part of a report. The OUTFIL statement allows you to write trailers that contain such a count as well as cumulative, or running, counts of records. Moreover, you can obtain these counts at the end of a report, at the end of a page, and at the end of a section.
To generate these counts, use the COUNT and SUBCOUNT subparameters (or COUNT15 and SUBCOUNT15). These subparameters can be used in conjunction with all other TRAILER entries. For syntax of COUNT and SUBCOUNT (as well as COUNT15 and SUBCOUNT15), see TRAILER Parameters (Optional).