|
|
QUERY/V Reference Manual: HP 3000 MPE/iX Computer Systems > Chapter 3 QUERY/V COMMANDSXEQ |
|
Executes QUERY commands from a file instead of the standard input device.
For example:
Where filename = FILE and option = ,NODATA
When the XEQ command is entered, QUERY reads the specified file and executes the commands until an end-of-file or another XEQ command is encountered. Any command input is also read from filename unless NODATA is specified. When an end-of-file is reached, control returns to the original command input device (in session mode, the terminal, or in job mode, the job input device). Only the first 72 characters of each record are read. You can continue a command on the next record by entering an ampersand (&) as the last non-blank character in the current record. If an error occurs while opening the data base in session mode, QUERY will close the XEQ file and prompt for another command. In job mode, QUERY closes the XEQ file and the job is terminated. An XEQ command within another XEQ file will close the first file and open the new one. The initial file is never reopened. QUERY performs an end-of-file on the first file and control transfers to the new file. The NODATA option specifies that the XEQ file only contains commands and does not contain any data needed by the command. QUERY will prompt you for the data. When you enter CONTROL Y during the execution of an XEQ file, QUERY will terminate the command currently executing, close the XEQ file and prompt for another command. If a FIND, MULTIFIND, or SUBSET command is executing when CONTROL Y is entered, QUERY will print the following message.
If you respond YES, QUERY will complete the search and execute the rest of the commands in the XEQ file. If you respond NO, QUERY will terminate the retrieval command, close the XEQ file, and prompt for another command. If you enter CONTROL Y in response to a value prompt, as in the case of null values and the NODATA option, QUERY will terminate the command, close the XEQ file, and prompt for another command. In some cases, a retrieval command with null values will create an execution loop where the only way to terminate the command is with CONTROL Y. The following is an example of an XEQ file which will create an execution loop. The XEQ file is named FINDACCT and contains:
Example 1 In this example, an XEQ file called FISET is used to define a particular QUERY session environment. The FISET file contains these records:
QUERY executes the DEFINE command and uses the other records as data in response to the DEFINE command prompts. If the NODATA option had been specified, QUERY would prompt you for each DEFINE prompt.
Example 2 This example shows how an XEQ file, PRXFIL, can be used to store and execute a pre-planned find-and-report sequence. It also shows the use of null data values and how the FIND CHAIN command can be used to access two data sets. Here, the information from CUSTOMER and SALES is used to prepare a bill.
Figure 3-11 Billing Report From an XEQ File
The XEQ file PRXFIL contains:
Since you want to be prompted for a value when the FIND CHAIN command containing a null data value is called, you use the NODATA option in the XEQ command. Note that if REPORT were called directly from the file, XEQ NODATA would prompt you for report statements instead of reading them from the file. Therefore, the REPORT command is stored as a procedure, BILL, in the current Proc-file, and is initiated from PRXFIL after the FIND CHAIN command. The procedure BILL contains:
|
|