LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous messageNext messagePrevious in topicNext in topicPrevious by same authorNext by same authorPrevious page (February 2011, week 1)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:   Thu, 3 Feb 2011 10:13:48 -0800
Reply-To:   "Nordlund, Dan (DSHS/RDA)" <NordlDJ@DSHS.WA.GOV>
Sender:   "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:   "Nordlund, Dan (DSHS/RDA)" <NordlDJ@DSHS.WA.GOV>
Subject:   Re: Fastest way to merge one record with set with multiple records?
In-Reply-To:   <20110203092114.E7A695B8@resin13.mta.everyone.net>
Content-Type:   text/plain; charset=utf-8

Mary,

How about this

data newdata; set members; do until(eof); set pharms end = eof; output; end; run;

hope this is helpful,

Dan

Daniel J. Nordlund Washington State Department of Social and Health Services Planning, Performance, and Accountability Research and Data Analysis Division Olympia, WA 98504-5204

> -----Original Message----- > From: SAS(r) Discussion [mailto:SAS-L@LISTSERV.UGA.EDU] On Behalf Of > Mary > Sent: Thursday, February 03, 2011 9:21 AM > To: SAS-L@LISTSERV.UGA.EDU > Subject: Fastest way to merge one record with set with multiple > records? > > Does anyone know of the fastest way to merge one record with multiple > records? This gets me what I want by expanding out the first file, but > I wonder if there's another way to do this. I am calculating distances > and need them both on the same data set, but always have one record in > the first data set and about 60,000 in the second. > > data members; > member_lat=99; > member_long=100; > do i=1 to 3; > output; > end; > drop i; > run; > > data pharms; > service_lat=101; > service_long=102; > output; > service_lat=201; > service_long=202; > output; > service_lat=301; > service_long=302; > output; > run; > > data newdata; > merge members pharms; > run; > > -Mary


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