BookmarkSubscribeRSS Feed
OS2Rules
Obsidian | Level 7

Hi All:

Quick question -

I have 2 SAS tables that have a lot of variables in them (200+) .  I expect that all variables except 1 are the

same (a datetime value).

Is there a way to run PROC COMPARE on all variables except 1 (like using a EXCLUDE=varname) ?

would rather not use a data step with a "DROP=" if it can be helped.  Also these tables a large so I need

to keep that in mind.

Thanks in advance.

4 REPLIES 4
Tom
Super User Tom
Super User

No. You can use the data set option DROP so it will not require a DATA step.

proc compare data=one(drop=ignore_me)  compare=two;

run;

OS2Rules
Obsidian | Level 7

Answered my own question...

use (DROP=variable) on each or the tables in the compare.

I didn't know the DROP= could be user there.....

DrAbhijeetSafai
Pyrite | Level 9

It was such a simple solution (to drop the variable from both sides), but did not click me. Thanks for sharing it. It worked. 

 

- Dr. Abhijeet Safai

Dr. Abhijeet Safai
Associate Data Analyst
Actu-Real
jakarman
Barite | Level 11

It has a been a long time ago using that.
Does the datasetoptions (like where) not work and than coding the drop there?. SAS(R) 9.4 Data Set Options: Reference

(did have diner before finishing the message)

---->-- ja karman --<-----

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!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

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
  • 4 replies
  • 4537 views
  • 6 likes
  • 4 in conversation