Date: Wed, 27 Mar 1996 20:47:16 GMT
Reply-To: Blind Robin <InDigestPress@WORLDNET.ATT.NET>
Sender: "SAS(r) Discussion" <SAS-L@UGA.CC.UGA.EDU>
From: Blind Robin <InDigestPress@WORLDNET.ATT.NET>
Organization: InDigest Press
Subject: Q: How to do a "many to many" merge?
I'm using SAS 6.09 under Unix. Can anyone help me with this problem?
I want to merge two datasets, each of which have multiple observations
of the BY variable I'll be using. I want the merge to output every
matching combination. It works fine when one or the other dataset has
just one observation in a BY group, but when both have multiple
observations, not all the combinations are generated.
For example, Dataset 1 contains an all the customer numbers and
equipment numbers for all customers who've purchased certain types of
equipment. Dataset 2 contains the customer numbers, equipment numbers,
and transaction numbers for all transactions involving certain other
types of equipment. I want to locate all the transactions in Dataset 2
for the customers in Dataset 1 (without summarizing Dataset 1 to the
customer level). Merging with customer number as the BY variable
doesn't work because the same customer can have multiple pieces of
equipment in Dataset 1 and multiple pieces of equipment and
transactions in Dataset 2.
My workaround for the time being has been to split Dataset 1 into
multiple datasets because, at least for now, there are only 15
different equipment numbers of interest from Dataset 1.
Thanks for any suggestions!