Desktop productivity for business analysts and programmers

Proc compare output

Reply
Occasional Contributor
Posts: 19

Proc compare output

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 Smiley Happy

 

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

Super User
Posts: 20,252

Re: Proc compare output

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. 

Super User
Super User
Posts: 8,190

Re: Proc compare output

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.

Ask a Question
Discussion stats
  • 2 replies
  • 100 views
  • 0 likes
  • 3 in conversation