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
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.
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.