HP 3000 Manuals

USING QUERY IN JOB MODE [ QUERY/V Reference Manual ] MPE/iX 5.0 Documentation


QUERY/V Reference Manual

USING QUERY IN JOB MODE 

In job mode, QUERY reads commands and other input from the job file.
Output from the job and QUERY messages are printed on the device
designated as $STDLIST, which is usually a line printer.

Only the first 72 characters of each line (record) are read by QUERY. Any
characters on the line beyond 72 characters are ignored.  If a QUERY
command is longer than 72 characters, you can continue it on the next
line by using an ampersand (&) as the last non-blank character on the
line to be continued.

As in session mode, you must open a primary data base before you can
access data.  You must do this at the beginning of your job file.  QUERY
commands which access the data base must follow the identification of the
primary data base.  If QUERY is unable to open the data base for any
reason, the job will terminate.

You must anticipate the order of the prompts issued by some QUERY
commands, such as DATA-BASE=, and supply the information on separate
lines in the job file.  If a command is out of sequence or incorrectly
entered, QUERY issues an error message and, in some cases, terminates the
job.

Some commands operate differently in job mode.  These differences in
command operation are discussed under the specific command in Section 3.

Figure 2-1shows a job file used to operate QUERY in job mode.
_________________________________________________________________________
|                                                                       |
|     :EDITOR                                                           |
|     HP32201A.7.17 EDIT/3000 MON, MAR 23, 1987 11:49 AM                |
|     (C) HEWLETT-PACKARD CO. 1985                                      |
|                                                                       |
|     /TEXT EXAMPLE                                                     |
|     /LIST ALL                                                         |
|          1     :JOB EXAMPLE,MANAGER.DATAMGT,ACCOUNTS                  |
|          2     :RUN QUERY.PUB.SYS                                     |
|          3     DATA-BASE=ORDERS                                       |
|          4     CLERK                                                  |
|          5     5                                                      |
|          6     DATA-SETS=CUSTOMER                                     |
|          7     FIND LAST-NAME IS MARTENSEN                            |
|          8     REPORT ALL                                             |
|          9     EXIT                                                   |
|         10     :EOJ                                                   |
|     /EXIT                                                             |
|     :STREAM EXAMPLE                                                   |
|     #J539                                                             |
|     :                                                                 |
_________________________________________________________________________

          Figure 2-1.  Job Mode Operation 

Discussion 

In a job file, the QUERY prompts (> and >>) must be excluded.  Only MPE
commands require prompts (:).

The first line of the job file must contain an MPE :JOB command.  The
second line contains an MPE :RUN command to initiate QUERY execution.

On line 3, the data base name, ORDERS, is specified using the DATA-BASE=
command.  The DEFINE command could also have been used to open the
primary data base.  In session mode the DATA-BASE= command prompts for
the password and access mode.  In job mode, this information must be
supplied on separate lines in the correct order and without the prompts.
In this example, the password is CLERK and the access mode is 5.

The data set name, CUSTOMER, is specified for the data set list using the
DATA-SETS= command.  The FIND command with retrieval specifications is
used on line 7.  The REPORT ALL command is used to display the entries
which qualified.

QUERY execution is terminated with the EXIT command on line 9.  The job
is terminated with an MPE :EOJ command (end of job) on line 10.  The MPE
:STREAM command is used to execute a job file.  MPE assigns and displays
a job number.

Refer to the MPE Commands Reference Manual for more information about
running programs in job mode.



MPE/iX 5.0 Documentation