This merge ran in 5 min on my machine.
data A(keep=KEY A1-A10)
B(keep=KEY B1-B10);
length A1-A10 B1-B10 8;
do I= 1 to 750e6;
KEY=ranuni(0);
if KEY < 500 / 750000 then output A;
output B;
end;
run;
data WANT;
if _N_=1 then do;
dcl hash A(dataset:'A');
A.definekey('KEY');
A.definedata('A1','A2','A3','A4','A5','A6','A7','A8','A9','A10');
A.definedone();
if 0 then set A;
end;
set B(keep=KEY B1 B2);
RC=A.find();
if RC=0;
run;
NOTE: There were 500029 observations read from the data set WORK.A. NOTE: There were 750000000 observations read from the data set WORK.B. NOTE: The data set WORK.WANT has 500029 observations and 14 variables. NOTE: DATA statement used (Total process time): real time 5:48.32 user cpu time 5:10.08 system cpu time 37.69 seconds memory 71702.09k OS Memory 98908.00k Timestamp 23/06/2017 10:57:57 AM Step Count 4411 Switch Count 665
... View more