

REPORT provides a command language for formatting result tables into reports.
REPORT commands can either be entered and executed step by step or appended to a SELECT statement as a complete sequence of commands.
The first method is recommended when output formats are designed in user dialog: the effect of each command can be checked at once and undesired results can be reset.
The second method is mainly applied for stored commands: calling the command produces the formatted report.
The source table to be formatted with REPORT is always the result table of a SELECT statement. Such a result table is represented in the standard layout that was valid during the execution of the SELECT statement.
The SELECT statement determines the choice and sequence of the result columns as well as the sorting of the result rows.
The report generator cannot modify the sequence of rows and columns; but it can, if requested, exclude result columns from the display and group the rows according to the specified sorting.
Within the REPORT commands, the result columns are identified either by their column numbers or by their (current) column headings. The numbers always refer to the columns in the SELECT statement; they can be displayed with the NUMBER command at any time.
REPORT commands are stored in the command history. They appear after the relevant SELECT statement, separated from it by the keyword REPORT.
REPORT OFF suppresses the display of the result table when the SELECT statement is executed. This helps to handle temporary results which occur while executing various SQL statements with a single RUN command.
REPORT <resulttablename> or REPORT ONLY is the counterpart of REPORT OFF. It redisplays either the most recently generated result table with the specified name or the last unnamed result table without performing a SELECT statement. REPORT ONLY helps to avoid waiting times when different reports must be generated from the result of a complex SELECT statement.

