HPlogo QUERY/V Reference Manual: HP 3000 MPE/iX Computer Systems > Chapter 3 QUERY/V COMMANDS

DATA-SETS=

» 

Technical documentation

Complete book in PDF
» Feedback

 » Table of Contents

Informs QUERY which data set to reference in the primary data base if a data item name which appears in more than one data set is used in a FIND, LIST, REPORT, or UPDATE command.

Syntax

   [DATA-SET]S= [data set list]

For example:

   >DATA-SETS=PAYROLL,ACCTREC



   >DATA-SETS=

Parameter

data set list

is a list of data sets you want to access. The list can contain data set names and dummy data set names. Each name must be separated from the next name by a comma. If data set list is not included, the data set list is cleared.

A dummy data set

is a temporary data set used in the JOIN command. The dummy data set is cleared from the data set list when the next JOIN command is entered.

Discussion

The DATA-SETS= command defines a list of one or more data sets. If you use a FIND, MULTIFIND, SUBSET, REPORT, or LIST command with a data item name which is in more than one data set in the primary data base, QUERY will check the data set list to determine which data set to use.

In an IMAGE data base, different data items can have the same name if each appears in a different data set. As mentioned in Section 1, you can use a fully-qualified data item name (data set name.data item name) to tell QUERY which data item to use. However, if you are using fully-qualified names for multiple data items, the command could become quite lengthy. The DATA-SETS= command may save you some time.

Data Set Selection Rules

Session Mode

If you reference a data item appearing in more than one data set, QUERY resolves which data set to use according to the following rule:

  • If one (and only one) of the data sets containing the data item appears in the data set list, QUERY automatically uses that data set. Otherwise QUERY prompts you to supply the desired data set with the message:

   data item name  IS A MEMBER OF THESE SETS:

   data set name,data set name, . . . .

   WHICH SET DO YOU WISH TO USE?



   >>data set name

You must type the name of the data set you want to access. If the name you provide does not match the names listed, QUERY repeats the prompt. If you decide you do not want to access the listed data sets, you may abort the command by pressing RETURN instead of entering a data set name. You will be prompted for another command.

Job Mode

QUERY cannot prompt you for the desired data set in the event of ambiguity. The data set to be accessed is chosen according to the following rules:

  • If exactly one data set containing the data item appears in the data set list, QUERY uses that data set.

  • If more than one of the data sets containing the data item appears in the data set list, QUERY uses the last data set mentioned in the list.

  • If no data set containing the data item is in the data set list, QUERY accesses the last data set in the data base that contains the data item and to which you have access. You may want to use the FORM data item name command in session mode before you prepare your job to determine the order of the data sets that include the data item. You can then decide what to include in the data set list.

QUERY will inform you of which data set was chosen, if there is any ambiguity, with this message:

   data item name  IS A MEMBER OF THESE SETS:

   data set name,data set name, . . . .

   data set name USED

Automatic Data Set List Additions

If a FIND or LIST command is executed which contains an unqualified data item name (i.e., a data item without a preceding data set name), QUERY automatically adds the name of the accessed data set to the data set list. This occurs whether the named data item appears in more than one data set or not.

To avoid any ambiguity when the name data item appears in multiple data sets, you can do one of two things:

  • Use fully-qualified data item names in all commands.

  • Always reset the data set list with the DATA-SETS= command prior to entering a command using a data item which appears in multiple sets.

Examples

Example 1

This example illustrates the DATA-SETS= command. Data set names are entered into the data set list. When the DEFINE command is issued, you can see which sets are currently in the list.

   >S=INVENTORY,SALES

   >DEFINE

   DATA-BASE = ORDERS.PUB.SYS

   DATA-BASE = >>RETURN

   PASSWORD = **********

   PASSWORD = >>RETURN

   MODE = 1

   MODE = >>RETURN

   DATA-SETS = INVENTORY,SALES

   DATA-SETS = >>RETURN

   PROC-FILE  = >>RETURN

   OUTPUT = TERM

   OUTPUT = >>RETURN

Example 2

This example illustrates how QUERY uses the data set list, clears it, and enters data set names automatically. The DEFINE command shows that the data set list currently contains the SALES data set. When using the FIND command to search entries with STOCK#=6650D22S, the SALES data set is automatically used since it is in the data set list. The DATA SET= command, followed by no data set names, clears the data set list. When FIND STOCK=6650D22S is used again, QUERY prompts for the data set to be used. The DEFINE command shows that the data set INVENTORY was automatically added to the data set list. When FIND STOCK#=7391Z22F is entered, the INVENTORY data set is used. However, in the next FIND command, the data set SALES is specified. In this case, the data set list is not used.

   >DEFINE

   DATA-BASE = ORDERS.PUB.SYS

   DATA BASE = >>RETURN

   PASSWORD = **********

   PASSWORD = >>RETURN

   MODE = 1

   MODE = >>RETURN

   DATA-SETS = SALES

   DATA-SETS = >>RETURN

   PROC-FILE  = MANPROC.IMAGE.DATAMGT

   PROC-FILE  = >>RETURN

   OUTPUT = TERM

   OUTPUT = >>RETURN

   >FIND STOCK#=6650D22S

   2 ENTRIES QUALIFIED

   >DATA-SETS=

   >FIND STOCK#=6650D22S

   STOCK#      IS A MEMBER OF THESE SETS:

   PRODUCT,SALES,INVENTORY

   WHICH SET DO YOU WISH TO USE?

   >>INVENTORY

   5  ENTRIES QUALIFIED

   >DEFINE

   DATA-BASE = ORDERS.PUB.SYS

   DATA-BASE = >>RETURN

   PASSWORD = **********

   PASSWORD = >>RETURN

   MODE = 1

   MODE = >>RETURN

   DATA-SETS = INVENTORY

   DATA-SETS = >>RETURN

   PROC-FILE  = MANPROC.IMAGE.DATAMGT

   PROC-FILE  = >>RETURN

   OUTPUT = TERM

   OUTPUT = >>RETURN

   >FIND STOCK#=7391Z22F

   2  ENTRIES QUALIFIED

   >FIND SALES.STOCK#= 7391Z22F

   8  ENTRIES QUALIFIED

   >
Feedback to webmaster