Thank you so much, SASKIwi, I didn't know it can be done that way. The code seems so easy. 1) Is there any problem using this way for merging 2 large datasets? For example, 1 dataset with 5K observations, and the other one with 3 millions records. 2) I would even like to consider comparing 3 variables and add the difference together, with the maximum allowed difference of 2. So the code will be something like the following? data Want (drop=i j k);
length str1 str2 var1 var2 cose1 code2 $20;
set data1;
set data2;
do i= 1 to max(length(Str1), length(Str2));
if substr(Str1,i,1) ne substr(Str2,i,1)
then Diff1+1;
end;
do j = 1 to max(length(Var1), length(Var2));
if substr(var1,j,1) ne substr(Var2,j,1)
then Diff2+1;
end;
do k = 1 to max(length(code1), length(code2));
if substr(code1,k,1) ne substr(code2,k,1)
then Diff3+1;
end;
put _all_;
if (Diff1+Diff2+Diff3) <= 2;
run;
... View more