SUMMARY (total and average selected records)
SUMMARY requests a tabular summary based on the first variable mentioned in the USING statement that precedes it.
A count is maintained for each item that has a common value matching the first variable. Only the totals appear on the report, followed by an average, for each and every numeric variable on the print line.
Even after all selection criteria have been met, each record generates a separate report line; the report could become quite large if a large volume of data is being processed.
If you provide summaries, your nominated summary fields will gather and condense all detail records into two lines of print for each control break.
If neither SUMMARY nor DETAIL is used, a tabular report is printed.
Syntax
Usage
SUMMARY can be coded only after the USING statement but prior to REPORT. If ORDER BY is used, SUMMARY must follow this statement.
Example
The following example produces the report shown in the following figure:
SET REPORTID = 'RES2RPT2'
SET TITLE = 'SUMMARY TRANSACTION ROSTER'
SELECT TYPE 6E RECORDS FROM CMRDETL
USING CMRDATE T6ERESP T6ECPUR T6EDIST T6EFCWT T6ESUST T6ETSWT
SUMMARY
REPORT
END
Summary report
TIME: 16:21:18
DATE: 09/17/1998
PAGE: 1
RECORDED RECORDED TRAN RESPONSE CPU REAL TERM OPR
DATE TOTAL TIME NAME TIME TIME ID. ID.
---- ------- -------- ---- -------- -------- ---- ---
1998/09/17 2 4.808 0.248
AVG ***** 2.404 0.124
1998/09/17 2 1.495 0.297
AVG ***** 0.747 0.148
Related topic