Finally, the "classic" data step method:
proc sort data=one;
by name;
run:
proc sort data=two;
by name;
run;
dara want;
merge
one (in=in_one)
two
;
by name;
if in_one;
run;
proc sort data=want;
by id;
run;
the hash method is fastest, but may run out of memory with large data
the data step method is best when dealing with large data that can't fit in memory, and scales until you run out of disk space in WORK/UTIL
the SQL is easy to understand for people not eloquent in SAS, scales like above, but can have performance problems with big data.
... View more