Hello,
I have to compare datasetA_Version1 with datasetA_Version2
V2 has more data than V1. There is NO unique identifier in this dataset.
The program should list:
So i can handle number 3.
But how can you compare 2 datasets without this unique identifier? Can you use proc compare herefore?
Thanks,
Filip
This can't be done, unless the additional observations appear at the end of one of the data sets. PROC COMPARE without a BY statements compares the first observation in one data set to the first observation in the other, then the second observation in the first data set to the second observation in the other.
A good rule of thumb to use: if you had all the data printed out on paper, could you find the differences? If the answer is "no", then SAS won't be able to either.
Is there a combination of variables is likely to identify records uniquely? If so you can try sorting both sets by those variables and then using Proc Compare. The default behavior compares the records by order in the data sets if no BY statement is used.
#1 - Look up the NOT EXISTS in sql to find records that aren't in 2 but are in 1.
#2 - I don't see how you can identify this at all if you don't have an identifier. You could only identify records in both that were identical, but not ones that had changed somehow.
#3 - That's easily done...
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!
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.