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.
Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!
Check out this tutorial series to learn how to build your own steps in SAS Studio.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.