Two-pass reports

A two-pass report is one that creates temporary tables, therefore there must be an active connection to the database.

The two-pass report handles sorts internally. During the first pass, the report engine sorts the data and stores the sorted values in a temporary file in the database. During the second pass, it calculates any aggregate values and produces output from data in the temporary files.

If your report definition includes any of the following, a two-pass report is required:

  • An ORDER BY section without the EXTERNAL keyword.
  • The GROUP PERCENT(*) aggregate function anywhere in the report.
  • Any aggregate function outside the AFTER GROUP OF control block.
Note: Some databases do not support temporary tables. Avoid a two-pass report for performance reasons and for portability.