![]() |
QUERY/iX Reference Manual
> Chapter 3 QUERY/iX COMMANDSDATA-SETS= |
|||||||||||||||||||
|
Syntax[DATA-SET]S= [data set list]For example: >DATA-SETS=PAYROLL,ACCTREC >DATA-SETS= Parameter
DiscussionThe 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 RulesSession 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:
data item name IS A MEMBER OF THESE SETS: data set name,data set name, . . . . WHICH SET DO YOU WISH TO USE? >>data set nameYou 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:
data item name IS A MEMBER OF THESE SETS: data set name,data set name, . . . . data set name USED Automatic Data Set List AdditionsIf 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:
ExamplesExample 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 = >>ReturnExample 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 >
|