HP3000-L Archives

February 2003, Week 3

HP3000-L@RAVEN.UTC.EDU

Options: Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
Michael Berkowitz <[log in to unmask]>
Reply To:
Michael Berkowitz <[log in to unmask]>
Date:
Wed, 19 Feb 2003 10:58:48 -0800
Content-Type:
text/plain
Parts/Attachments:
text/plain (62 lines)
Thomas Root writes


Does Query have a way to Join two datasets using two fields?

I'm looking for something like:

   Join DataSet1 to DataSet2 where
     DataSet1.FieldA = DataSet2.FieldX  ** AND **
     DataSet1.FieldB = DataSet2.FieldY

TIA,

Tom Root
Desert Schools FCU
[log in to unmask]
----------------------------------------------------
From the Query manual at http://docs.hp.com  It appears Query allow up to 52 join equivalences.

   J[OIN] data item equivalence [,data item equivalence]...
   [;data set equivalence [,data set equivalence]...] [END]

Parameters 

data item equivalence
  has the form:

   [data base name:] data set name. data item name
 
   [(subscript)] [@] TO [@] [data base name:]
 
   data set name. data item name [(subscript)]

data base name is the name of a data base specified in either the DEFINE, DATA-BASE=, or MULTIDB command.

data set name is the name of a data set that is to be included in the compound data set being specified. If data base name is used, the data set must belong to that data base.

data item name is the name of the data item that links the joined data sets together. The data item must belong to the specified data set.

subscript is a number used to indicate which sub-item you want to join. Subscript must be an integer >= 1 and <= the number of sub-items defined for the compound item. QUERY will default to the first sub-item if no subscript is specified.

@ means "preserve all values of" the data set associated with the @ sign. This parameter is explained in detail later in "Using the @ Parameter".
data set equivalence
  has the form:

   dummy data set name = data set name

dummy data set name is a temporary name for the data set named on the right side of the data set equivalence. A dummy data set cannot be a legal data set name in any open data base.
END   may be used to end a JOIN command.

Discussion 

The JOIN command allows the retrieval and reporting of data item values from multiple data sets by creating a logical relation between data sets. The relation is established by equating a data item from one set with a data item from a second data set. These data item equivalences, of which QUERY allows up to 52, define a compound data set.

Once you have defined a compound data set with the JOIN command, you must enter a MULTIFIND or a MULTIFIND ALL command to actually create the compound data set and access the desired items. Refer to the MULTIFIND or MULTIFIND ALL commands in this manual for details on their operation. You can only report from those data sets used in the JOIN command.

Mike Berkowitz
Guess? Inc.

* To join/leave the list, search archives, change list settings, *
* etc., please visit http://raven.utc.edu/archives/hp3000-l.html *

ATOM RSS1 RSS2