BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
ybz12003
Rhodochrosite | Level 12

Hello, 

 

I would like to compare two datasets, A and B. Both of them have around the same 20 columns, some are numeric and some are characteristic.  Please show me how to approach it.

1 ACCEPTED SOLUTION

Accepted Solutions
maguiremq
SAS Super FREQ
proc compare listbase listcompare
base = a compare = b;
id <enter your ID or ID's of choice here>; /* Remove the < and > - those are just placeholders */
var <enter your vars here>; /* Remove the < and > - those are just placeholders */
run;

Documentation: https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/proc/n0c1y14wyd3u7yn1dmfcpaejllsn.htm

 

This is the best I can do for you without a reproducible example. If you're unable to get what you need, please post some example data or use this macro to generate data sets from your actual data, ensuring you don't have anything confidential in them.

View solution in original post

2 REPLIES 2
PaigeMiller
Diamond | Level 26

PROC COMPARE will do this.

--
Paige Miller
maguiremq
SAS Super FREQ
proc compare listbase listcompare
base = a compare = b;
id <enter your ID or ID's of choice here>; /* Remove the < and > - those are just placeholders */
var <enter your vars here>; /* Remove the < and > - those are just placeholders */
run;

Documentation: https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/proc/n0c1y14wyd3u7yn1dmfcpaejllsn.htm

 

This is the best I can do for you without a reproducible example. If you're unable to get what you need, please post some example data or use this macro to generate data sets from your actual data, ensuring you don't have anything confidential in them.

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

How to Concatenate Values

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

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