FINISH REPORT
The FINISH REPORT
instruction finalizes a report execution.
Syntax
FINISH REPORT report-name
- report-name is the name of the report to be ended.
Usage
FINISH REPORT
closes the report driver.
Therefore, it must be the last statement in the report driver and must follow a
START REPORT
statement that specifies the name of the same report.
FINISH REPORT
must be the last statement in the report driver.
FINISH REPORT
does the following:
- Completes the second pass, if report is a two-pass report. These 'second pass' activities handle
the calculation and output of any aggregate values that are based on all the input records in
the report, such as
COUNT(*)
orPERCENT(*)
with noGROUP
qualifier. - Executes any
AFTER GROUP OF
control blocks. - Executes any
PAGE HEADER
,ON LAST ROW
, andPAGE TRAILER
control blocks to complete the report. - Copies data from the output buffers of the report to the destination.
- Closes the Select cursor on any temporary table that was created to order the input records or to perform aggregate calculations.