wow...sort of difficult to follow... best I could do was build on the first approach. data HAVE; input ADNUM SSN NAME $ DOB; format dob datetime20; match1 = catx('',put(ssn,z9.),trim(name)); match2=catx('',put(ssn,z9.),put(dob,best12.)); match3=catx('',trim(name),put(dob,best12.)); cards; 101 856116534 ABCD 18760323 187 856176354 ABCD 18760323 233 856176354 ABCD 18670323 456 850176534 ABCD 18760323 490 856176534 ABEF 18670323 535 856176534 ABGF 18760323 601 856176534 ABEF 18760323 632 856176534 ABEE 18760323 879 856116534 ABEF 18760323 911 856176534 ABGF 18760323 919 123456789 JOHN 19000224 200 000089712 DAVE 20000212 ; run; proc sql; create table want as select t1.adnum as adnum1 ,t2.adnum as adnum2 from have t1 inner join have t2 on (t1.match1 = t2.match1 or t1.match2=t2.match2 or t1.match3=t2.match3) and t1.adnum < t2.adnum; quit;
... View more