BookmarkSubscribeRSS Feed
Jaheuk
Obsidian | Level 7

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_0-1615480836494.png

 

Jaheuk_1-1615480894498.png

 

2 REPLIES 2
ballardw
Super User

@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??

 

Jaheuk_0-1615480836494.png

 

Jaheuk_1-1615480894498.png

 


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.

SAS Innovate 2025: Call for Content

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!

Submit your idea!

What is Bayesian Analysis?

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 2 replies
  • 773 views
  • 2 likes
  • 3 in conversation