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: 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!

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.

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
  • 723 views
  • 2 likes
  • 3 in conversation