can i write the below two steps in one step?
proc sql;
create table tempexclusion as
select b.*
from acc as a
right join prep as b
on a.tlnbr = b.phone
where a.tlnbr is not null;
quit;
proc sql UNDO_POLICY=NONE;
create table prep as
select b.*
from acc as a
right join prep as b
on a.tlnbr = b.phone
where a.tlnbr is null;
quit;
I may be somewhat blind, but what is the difference between the two steps (a part from different target table names)???
If the question is if you can create multiple table in one SQL statement, so, no, not in SAS.
Oh, no I see, not is a small word...
Well, I guess you just need to remove the where clause. Or what is you want?
If you mean to call proc SQL only once, you can use the reset statement :
proc sql;
create table tempexclusion as
select b.*
from acc as a
right join prep as b
on a.tlnbr = b.phone
where a.tlnbr is not null;
RESET UNDO_POLICY=NONE;
create table prep as
select b.*
from acc as a
right join prep as b
on a.tlnbr = b.phone
where a.tlnbr is null;
quit;
PG
is the reset option better in terms of efficiency or run time? or am i just reducing few lines of code?
thanks for the reply
There must be a small efficiency gain but I doubt you will ever notice the difference. - PG
thank you
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
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.