Hi Ksharp, Thanks for correction...Here i have updated my above code...Hope it works in case of any kind of Data Structure... Data one; input Cusip Year aa; cards; 100 97 10 101 98 2 102 97 . 103 98 2 ; Data two; input Cusip Year bb; cards; 101 98 . 102 97 . 103 98 3 104 99 5 ; proc sql; create table both as select coalesce(a.cusip,b.cusip) as cusip, coalesce(a.year,b.year) as year, aa,bb, case when a.cusip = b.cusip then "Match" when aa = . and bb = . then "Match" when bb = . then "Two" when aa = . then "One" else "Match" end as source from one as a full join two as b on a.cusip = b.cusip; quit; -Urvish
... View more