SAS Procedures

Help using Base SAS procedures
BookmarkSubscribeRSS Feed
podarum
Quartz | Level 8

Hi, as you can see I'm not that familiar with proc sql, but how can I subtract the results from one table from another table?  using minus.?

If I have table A with 20,000 records and table B a subsidiary of A with 12,000, I want to get Table C with the remaining 18,000 recods.. in PROC SQL Thanks

1 REPLY 1
Haikuo
Onyx | Level 15

Use 'except':

proc sql;

create table c as

   select * from a

  except

  select * from b;

I suppose that you had a typo in your post: B has 2000 obs instead of 12000.

Haikuo

sas-innovate-white.png

Our biggest data and AI event of the year.

Don’t miss the livestream kicking off May 7. It’s free. It’s easy. And it’s the best seat in the house.

Join us virtually with our complimentary SAS Innovate Digital Pass. Watch live or on-demand in multiple languages, with translations available to help you get the most out of every session.

 

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 1 reply
  • 31515 views
  • 1 like
  • 2 in conversation