I want to peform left outer join in hash with following code (so as to reproduce the result of left join in Proc Sql). data a; input key d1 d2 d3; datalines; 1 1 1 1 1 2 2 2 1 3 3 3 2 1 1 1 2 2 2 2 4 1 1 1 4 1 1 1 5 5 5 5 ; data b; input key d4 d5 d6 other; datalines; 1 1 1 1 0 2 2 2 2 0 3 3 3 3 0 4 4 4 4 0 ; data test(drop=rc); if 0 then set A; if _n_=1 then do; dcl hash h(dataset:'A',multidata:'yes'); h.definekey('key'); h.definedata('d1','d2','d3'); h.definedone(); end; set B (keep=key d4 d5 d6); rc=h.find(); do while(rc=0); output; rc=h.find_next(); end; run;
... View more