DATA Step, Macro, Functions and more

SQL equivalent

Reply
Frequent Contributor
Posts: 75

SQL equivalent

DATA TABLE1;
 SET TABLE2
     TABLE3
     TABLE4;
 KEEP OBS2 OBS4;
RUN;
Valued Guide
Posts: 860

Re: SQL equivalent

[ Edited ]

Union All will include duplicates.  Union will remove duplicates:

 

proc sql;
create table table1 as
select obs2,obs4
from table2
union
select obs2,obs4
from table3
union
select obs2,obs4
from table4;

Ask a Question
Discussion stats
  • 1 reply
  • 150 views
  • 2 likes
  • 2 in conversation