Help using Base SAS procedures

recode

Reply
Frequent Contributor
Posts: 87

recode

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;

Super User
Posts: 5,255

Re: recode

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.

Data never sleeps
Super User
Posts: 5,255

Re: recode

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?

Data never sleeps
Respected Advisor
Posts: 4,641

Re: recode

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

PG
Frequent Contributor
Posts: 87

Re: recode

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

Respected Advisor
Posts: 4,641

Re: recode

There must be a small efficiency gain but I doubt you will ever notice the difference. - PG

PG
Frequent Contributor
Posts: 87

Re: recode

thank you

Ask a Question
Discussion stats
  • 6 replies
  • 227 views
  • 6 likes
  • 3 in conversation