Hi everyone,
I'd like to compare two data sets for a time overlap period to see if they yield the same results. Where the data is not equal I'd like there to be an output column that indicates so with a flag i.e 0 = matching and 1 = no match. I'd also like another column for the reason they are not matching.
Note: I CANNOT share my data. I know this makes it hard, I'm hoping it does not make it impossible 🙂
Currently my code is:
proc compare base=data1 compare=data2out=comparison LISTOBS;
by x1 x2 x3;
ID x1 x2 x3;
run;
Any help is appreciated.
Thanks
I don’t think PROC COMPARE will work. You need a merge or join, so a manual comparison.
We never need your actual data, just data that’s representative.
Who is asking you to share your data? Post test data in the form of a datastep and use the {i} code window. Test data can be anything and only needs to be a couple of rows to demonstrate. You will also need to show what you want out as "I'd also like another column for the reason they are not matching." doesn't give any indications.
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!
What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.
Find more tutorials on the SAS Users YouTube channel.