BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
alepage
Barite | Level 11

Many of our oracles tables will be changed in few weeks.  Up to now, we have test table are available but, the number of observations is low compare to the original table.

 

I would like to compare the old table with the test table but I want to paired the idnumber of the old table with the idnumber of the test table then compare the other variables.

 

Is there a nice way to do that with proc compare?

Regards,

1 ACCEPTED SOLUTION

Accepted Solutions
ballardw
Super User

It would depend on just what you are looking for from the comparison. Proc compare is often not the best choice when there is a significant difference in the number of records between the two data sets.

You should describe exactly what you are looking for from the comparison.

 

If you are trying to determine if values from the test data set differ from those in the base data only for the idnumbers in the test data set then the approach would be to select the records from the base data set based on those in the test set and then use proc compare. Something like:

 

Proc sql;

    create table baseid as

    select b.*

    from (select distinct idnumber from test) as a

            left join

            base as b

            on a.idnumber = b.idnumber

   ;

run;

 

If there were other specific types of questions about the two sets then you may need to provide more details.

View solution in original post

1 REPLY 1
ballardw
Super User

It would depend on just what you are looking for from the comparison. Proc compare is often not the best choice when there is a significant difference in the number of records between the two data sets.

You should describe exactly what you are looking for from the comparison.

 

If you are trying to determine if values from the test data set differ from those in the base data only for the idnumbers in the test data set then the approach would be to select the records from the base data set based on those in the test set and then use proc compare. Something like:

 

Proc sql;

    create table baseid as

    select b.*

    from (select distinct idnumber from test) as a

            left join

            base as b

            on a.idnumber = b.idnumber

   ;

run;

 

If there were other specific types of questions about the two sets then you may need to provide more details.

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

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
  • 1 reply
  • 587 views
  • 0 likes
  • 2 in conversation