REPORT procedure [ QUERY/V Reference Manual ] MPE/iX 5.0 Documentation
QUERY/V Reference Manual
REPORT procedure
Executes a REPORT command stored as a procedure in the current Proc-file.
Syntax
R[EPORT] [output control statements;] procedure name [,character]
For example:
>REPORT REP4,J
Where procedure name = REP4, character = J
>R FINDTAX
Where procedure name = FINDTAX
Parameters
output control Refer to the section on Output Control Statements
statements in the REPORT command.
procedure name is the name of a REPORT command stored as a
procedure in the current Proc-file.
character is any printable ASCII character. If character is
included in this command, the REPORT procedure is
listed before it is executed.
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 3-4, for example, shows a REPORT procedure named SHIPMNTS. The
third line contains a sort statement with a comma missing.
________________________________________________________________________
| |
| PROCEDURE: REP4 |
| |
| 001 REPORT |
| 002 H1,"MONTHLY SHIPMENTS",25,SPACE A2 |
| 003 S1 STOCK,STOCK# |
| 004 G1,STOCK#,15 |
| 005 D1,LASTSHIPDATE,25 |
| 006 END |
________________________________________________________________________
Figure 3-4. REPORT Procedure Named SHIPMNTS
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.
MPE/iX 5.0 Documentation