SQL/MP Report Writer Guide

Using SQLCI and the Report Writer
HP NonStop SQL/MP Report Writer Guide527213-001
2-13
Executing a Command Repeatedly
OUT_REPORT Files
You can direct output from a SELECT command, both default reports and customized
reports, to a specific file by using the OUT_REPORT command. Enter the following
command to direct reports to a disk file named DRAFT:
>> OUT_REPORT DRAFT;
The following command directs reports to a spooler collector for a printer:
>> OUT_REPORT $S.#PRINTXX;
Log Files
If you specify a log file for your session by entering the LOG command, SQLCI logs the
commands you enter and the information that the commands produce to a log file. The
content of the log file is the same as the information you see on your screen when the
OUT file is your terminal and you have not specified an OUT_REPORT file. Optionally,
you can specify that you want only the commands written to the log file.
If you want to print a report, and you want the report definition to be printed preceding
the report, you can use the log file.
Suppose the file REPORT55 contains all the commands needed to print a report. The
first command in the file is:
LOG $S.#PRINTER;
Enter the following command to print the definition as well as the report:
>> OBEY REPORT55;
As the commands in the command file execute, they are logged to the log file. The
report is written to the log file and to the OUT_REPORT file.
To turn logging off, enter:
>> LOG;
Executing a Command Repeatedly
There are three ways to execute commands repeatedly:
Use the FC, !, and HISTORY commands.
Use the PREPARE and EXECUTE commands. (For an example, see Preparing a
SELECT Command on page 3-24.)
Use the OBEY command.
If you want to execute a set of commands repeatedly, you should put the commands in
an command file. You can either use a text editor to create the file or enter the
commands interactively and then use the SAVE command to write them to a command
file. For more information on examples of creating command files, see Defining
Reports in Command Files on page 2-15.