BookmarkSubscribeRSS Feed
Scott86
Obsidian | Level 7

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

2 REPLIES 2
Reeza
Super User

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. 

RW9
Diamond | Level 26 RW9
Diamond | Level 26

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.

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

SAS Enterprise Guide vs. SAS Studio

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.

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
  • 697 views
  • 0 likes
  • 3 in conversation