If I understand right then you're after something like below.
/* Create sample data */
data have;
input Base :$20. Compare :$20.;
datalines;
123456 123,456
ABC123 ABC123
HelloWorld Hello,World
789012 789012
987654 987,654
Test123 Test123
SASCode SAS,Code
987654 9876,54
;
run;
data compare;
set have;
if 0 then
do;
/* define new vars with same length than orig vars */
base2 =base;
compare2=compare;
end;
/* define regex to remove thousand separator */
prxid=prxparse('s/,(\d{3})/$1/');
base2=prxchange(prxid,-1,strip(Base));
compare2=prxchange(prxid,-1,strip(Compare));
diff_flg= (base2 ne compare2);
run;
proc print data=compare;
run;
... View more