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 (November 2006, week 2)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Sun, 12 Nov 2006 10:00:05 -0500
Reply-To:     "Richard A. DeVenezia" <rdevenezia@WILDBLUE.NET>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         "Richard A. DeVenezia" <rdevenezia@WILDBLUE.NET>
Subject:      Re: Quick and hopefully easy question
Comments: To: sas-l@uga.edu

alves wrote: > Hi guys. > > Need to make a stange merge, and having some problems how to do it (at > least with datasteps). > > I have 2 datasets (treatment and no-treatment) and I need to merge the > datasets in a way that each observation in the treatment dataset will > be merged with all no-treatment patients with the same age. some > treatments patients have the same age and when the age repeats I need > again all no-treatment patients. > > Datasets are pretty big so I trying to find a way that optimises > speed.

Have you reached some bottleneck or case where a current method takes "too long".

How big is big? - How many rows and columns in each table? - Does one table consistently have more rows than the other ?

Are the tables indexed?

What have you tried, if anything?

Was it anything like a left join? ---------------------------------- data one(index=(focus1=(id1 id2) age)); input id1 $ id2 $ age; cards; a xx 25 a yy 30 c tt 25 d tt 35 e zz 40 run;

data two (index=(id age)); input id age; cards; 1 25 2 25 3 30 4 35 5 35 6 25 7 25 8 30 run;

options msglevel=I;

proc sql; create table three as select one.*, two.id from one left join two on one.age = two.age order by id1, id2, id ; quit; ----------------------------------

There are many other ways to join data.

Richard A. DeVenezia http://www.devenezia.com/


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