LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous (more recent) messageNext (less recent) messagePrevious (more recent) in topicNext (less recent) in topicPrevious (more recent) by same authorNext (less recent) by same authorPrevious page (February 2000, week 1)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Tue, 8 Feb 2000 00:29:57 GMT
Reply-To:     Lou Pogoda <lpogoda@HOME.NOSPAM.COM>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         Lou Pogoda <lpogoda@HOME.NOSPAM.COM>
Organization: @Home Network
Subject:      Re: many to many match merge

That turns out not to be the case - example code has been posted here in the past. Assuming the key variable to "merge" on is called KEYVAR and is present on both data sets, a crude version would look something like:

data foo; set fee; do n = 1 to howmany; set fie (rename = (keyvar = keevar)) nobs = howmany point = n; if keevar = keyvar then output; end; run;

I say crude because this example compares every observation in FIE with every observation in FEE. Modifying it to take advantage of key-value order is left as an exercise for the reader.

Such code is admittedly a little more complicated to write than the SQL version. On the other hand, depending on platform, observation size, and the phase of the Moon, I've seen the data step version take slightly over half as much cpu time as the sql version.

David L. Ward wrote in message <200002071541857.SM00138@www3>... >There's no way to do this in a data step, only proc SQL: >proc sql; > select tablea.userid, tablea.group, tableb.profile from tablea, tableb where tablea.group=tableb.group; >quit; > > >HTH >David Ward


Back to: Top of message | Previous page | Main SAS-L page