Can you add a little example of what you mean? Do you mean you have data where the only difference is in the third decimal place, like:
data a ;
x=1.501 ;
run ;
data b ;
x=1.502 ;
run ;
proc compare base=a compare=b ;
run ;
And you want PROC COMPARE to report that those two values are equal? If that's what you mean, look into the CRITERION option.
You can add a FORMAT statement:
data a ;
x=200 ;
run ;
data b ;
x=220 ;
run ;
proc compare base=a compare=b ;
format x 8. ;
run ;
That doesn't impact the comparison, but will show X formatted with no decimal places:
|| Base Compare Obs || x x Diff. % Diff ________ || _________ _________ _________ _________ || 1 || 200 220 20.0000 10.0000 _________________________________________________________
The difference still shows decimal places. If you don't want that, you might be able to edit a table template or something like that. I don't see a MAXDEC option or similar for PROC COMPARE.
Apparently PROC COMPARE does not actually use a table template, so I'm not sure you can fully customize this.
See this paper by the great Jane Eslinger, which has a section on COMPARE
https://www.pharmasug.org/proceedings/2019/BP/PharmaSUG-2019-BP-039.pdf
Jane suggests for custom output from PROC COMPARE, you may want to output the results to a dataset, then use PROC REPORT or whatever to display they results.
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.