when I use proc compare to compare 2 data sets AND everything is 100% the same,
I still get output because I use the ID statement
how can I avoid this??
@Jaheuk wrote:
when I use proc compare to compare 2 data sets AND everything is 100% the same,
I still get output because I use the ID statement
how can I avoid this??
What does your log show?
ID does not "cause" this. Example:
proc sort data=sashelp.class
out=work.class1;
by name;
run;
proc sort data=sashelp.class
out=work.class2;
by name;
run;
proc compare data=work.class1
compare=work.class2
outnoequal out=work.compare
method=absolute criterion=0.5;
id name;
run;
Which in my log:
NOTE: There were 19 observations read from the data set WORK.CLASS1.
NOTE: There were 19 observations read from the data set WORK.CLASS2.
NOTE: The data set WORK.COMPARE has 0 observations and 7 variables.
NOTE: PROCEDURE COMPARE used (Total process time):
real time 0.00 seconds
cpu time 0.00 seconds
So an ID statement does not cause any issue.
So one questions the claim of "100% the same".
You might try removing the NOPRINT option and seeing what specific values are being reported as unequal.
For example if I modify the weight value for Alice in the above example I get a table like:
Value Comparison Results for Variables
__________________________________________________________
|| Base Compare
Name || Weight Weight Diff. % Diff
________ || _________ _________ _________ _________
||
Alice || 99.0000 84.0000 -15.0000 -15.1515
__________________________________________________________
Which shows which specific value for the ID variables has a difference.
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!
Still thinking about your presentation idea? The submission deadline has been extended to Friday, Nov. 14, at 11:59 p.m. ET.
Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.