HP 3000 Manuals

USING PROCEDURES IN A PROC-FILE [ QUERY/V Reference Manual ] MPE/iX 5.0 Documentation


QUERY/V Reference Manual

USING PROCEDURES IN A PROC-FILE 

A single QUERY command can be stored as a named procedure for repeated
use without re-entering the command.  The commands which can be used in a
procedure are listed in Table 2-2.

You execute a procedure by referencing it with a form of the command used
in the procedure.  Refer to Table 2-2 for the commands that are used to
execute procedures.  For example, if a procedure named FINDNAME contains
the FIND command, you would execute the procedure by typing:

     >FIND FINDNAME

You store one or more procedures in an MPE file called a Proc-file.  Only
one Proc-file is "active" at any time.  The active Proc-file is called
the current Proc-file.  When you execute a procedure, QUERY searches the
current Proc-file for the specified procedure.  Therefore, before
executing a procedure, you must specify the current Proc-file with the
PROC-FILE= command or in response to the prompt issued by the DEFINE
command.  To access a Proc-file, you must have read and lock access to
the group and account in which the Proc-file resides.

          Table 2-2.  Procedure Commands 

---------------------------------------------------------------------------------------------
|                                             |                                             |
|            USED IN THE PROCEDURE            |           EXECUTES THE PROCEDURE            |
|                                             |                                             |
---------------------------------------------------------------------------------------------
|                                             |                                             |
|            FIND                             |                                             |
|                                             |                                             |
|            FIND ALL                         |           FIND procedure                    |
|                                             |                                             |
|            FIND CHAIN                       |                                             |
|                                             |                                             |
---------------------------------------------------------------------------------------------
|                                             |                                             |
|            JOIN                             |           JOIN procedure                    |
|                                             |                                             |
---------------------------------------------------------------------------------------------
|                                             |                                             |
|            MULTIFIND                        |           MULTIFIND procedure               |
|                                             |                                             |
|            MULTIFIND ALL                    |           MULTIFIND procedure               |
|                                             |                                             |
---------------------------------------------------------------------------------------------
|                                             |                                             |
|            REPORT                           |           REPORT procedure                  |
|                                             |                                             |
|            REPORT ALL                       |           REPORT procedure                  |
|                                             |                                             |
---------------------------------------------------------------------------------------------
|                                             |                                             |
|            SUBSET                           |           SUBSET procedure                  |
|                                             |                                             |
---------------------------------------------------------------------------------------------
|                                             |                                             |
|            UPDATE ADD *                     |                                             |
|                                             |                                             |
|            UPDATE DELETE *                  |           UPDATE procedure                  |
|                                             |                                             |
|            UPDATE REPLACE *                 |                                             |
|                                             |                                             |
---------------------------------------------------------------------------------------------

* In a procedure, the updating commands must include the UPDATE keyword.

A procedure can be created within QUERY or copied from an MPE ASCII file.
The QUERY commands that operate on procedures are discussed in Table 2-3.

          Table 2-3.  Commands Used to Define Procedures 
---------------------------------------------------------------------------------------------
|                                  |                                                        |
|             COMMANDS             |                        FUNCTION                        |
|                                  |                                                        |
---------------------------------------------------------------------------------------------
|                                  |                                                        |
|             CREATE               | Creates a procedure or copies it from an MPE ASCII     |
|                                  | file and stores it in the current Proc-file.  The      |
|                                  | CREATE SPACE option shows the number of unused records |
|                                  | in the current Proc-file.                              |
|                                  |                                                        |
|             DISPLAY              | Lists the names of the procedures in the current       |
|                                  | Proc-file or lists individual procedures with line     |
|                                  | numbers for use in editing.                            |
|                                  |                                                        |
|             ALTER                | Edits a procedure stored in the current Proc-file.     |
|                                  | This command is used to insert, replace, and delete    |
|                                  | lines.                                                 |
|                                  |                                                        |
|             DESTROY              | Deletes a procedure from the current Proc-file.        |
|                                  |                                                        |
|             RENAME               | Changes the name of a procedure in the current         |
|                                  | Proc-file.                                             |
|                                  |                                                        |
---------------------------------------------------------------------------------------------



MPE/iX 5.0 Documentation