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.
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.
PROC COMPARE will do this.
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 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
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.
Ready to level-up your skills? Choose your own adventure.