|
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
|