Executes a REPORT command stored as a procedure in the current
Proc-file.
Syntax |
 |
R[EPORT] [output control statements;] procedure name [,character] |
For example:
Where procedure name = REP4, character = J
Where procedure name = FINDTAX
Discussion |
 |
QUERY searches the current Proc-file and executes the REPORT
command stored under the procedure name. The data entries used are those located by the previous
retrieval command. If the procedure does not exist in the current
Proc-file, or if the Proc-file has not been declared, QUERY prints
an error message.
Before the procedure is executed, QUERY checks it for proper
syntax. If any statement (except the first one) is incorrect, QUERY
issues an error message and prompts you with >>.
At this point, you can enter one or more statements to replace the
statement causing the error. The statements must be on one line
and separated by semicolons. If any of these substitute statements
is in error, QUERY issues another error message and prompts you again.
Once satisfactory statements have been entered, QUERY executes the
procedure using the newly entered statements in place of the statements
in error. If the first report statement is in error, the REPORT
command terminates.
The corrected statements are not permanent. Once the procedure
has executed, the entered statements are lost. The procedure remains
unchanged in the Proc-file. To permanently change the procedure,
you must use the ALTER command.
Figure 6-1 “REPORT Procedure Named SHIPMNTS”, for example, shows a REPORT
procedure named SHIPMNTS. The third line contains a sort statement
with a comma missing.
When the procedure is executed. QUERY prints the offending
sort statement and prompts for a correction. Once you enter a correct
statement or series of statements, execution of the procedure continues.
For example you might respond with:
>REPORT REP4 003 S1 STOCK# EXPECTED A "," >>S1,STOCK#;S,LASTSHIPDATE |
Not only has the sort statement been temporarily fixed, but
another sort statement has been added as well. Once the procedure
has executed, the corrections and additions are lost.
When using REPORT procedures, you can leave out END. When
the procedure is executed, QUERY will prompt you for the missing
END. You can then enter special sort or output control statements
to vary the report and its output parameters. The added statements
are lost once the procedure is executed.