The report prototype
When defining a report routine, the report name must immediately follow the
REPORT
keyword. The name must be unique among function and
report names within the program. Its scope is the entire program.
The list of formal arguments of the report must be enclosed in parentheses and separated by commas. These are local variables that store values that the calling routine passes to the report.
When you call a report, the formal arguments are assigned values from the
argument list of the OUTPUT TO REPORT
statement. These actual
arguments that you pass must match, in number and position, the formal arguments
of the REPORT
routine. The data types must be compatible, but
they need not be identical. The runtime system can perform some conversions
between compatible data types.
The names of the actual arguments and the formal arguments do not have to match.
- All the values for each row sent to the report in the following
cases:
- If you include an
ORDER BY
section orGROUP PERCENT(*)
function - If you use a global aggregate function (one over all rows of the report)
anywhere in the report, except in the
ON LAST ROW
control block - If you specify the
FORMAT EVERY ROW
default format
- If you include an
- Any variables referenced in the following group control blocks: