Date: Fri, 2 Jun 2006 14:51:19 -0700
Reply-To: "Pardee, Roy" <pardee.r@GHC.ORG>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: "Pardee, Roy" <pardee.r@GHC.ORG>
Subject: Re: Question on pattern matching between two dissimilar sas
datasets
Content-Type: text/plain; charset="us-ascii"
The transpose rubs me wrong too--I don't think you need it.
If the "straight merge" results you list below consist of one copy of
dset2 for each row in dset1 (aka a 'cartesian product') then that's
good--that's what you want. You just throw a subsetting if in there to
strain out any rows that don't meet your criteria. Something like:
Data gnu ;
merge dset1 dset2 ;
by <<something>>? ;
if prxmatch(<<something clever>>) > 0 ;
Run ;
(Told you I couldn't remember how to do datastep merges...)
-----Original Message-----
From: sunspark@gmail.com [mailto:sunspark@gmail.com] On Behalf Of Peter
Constantinidis
Sent: Friday, June 02, 2006 2:38 PM
To: Pardee, Roy
Subject: Re: Question on pattern matching between two dissimilar sas
datasets
Hi thanks for writing, though I don't know how to use proc sql so I
guess I should read up and see if it can be of assistance because I
don't entirely understand your example code.
But you bring up a good point, I should describe a simplified form of
the datasets better.
Dataset 1: 10,000 observations, 2 variables- name and 30 digit serial
number.
Dataset 2: 5,000 observations, 1 variable- 5 digit number.
I can't do a straight merge because then I would have like:
Bob 123456890123456890123456890 99991
Jay 123456890123456890123456890 99992
etc..
That's why I thought transpose might work because then it'd be like:
Name Serial var1 --- var5000
Bob 123456890123456890123456890 94991 -- 99999 Jay
123456890123456890123456890 94991 -- 99999 ...etc.
But it's not ideal to make it wide. Hmm.