I have a basic question:
data test; set temp1 temp2;run;Temp1 and temp2 are 2 datasets with similar columns. Can somebody explain what this command is doing. Is it a union of the two datasets. Is there a better proc sql alternative to combine temp1 and temp2.
Thanks
This is like a union all in sql. But compare your data step code with the necessary sql code:
proc sql;
create table test as
select * from temp1
union all
select * from temp2;
quit;
and you'll see why it's rarely used when the data step is much more concise. Aside from the fact that the data step has capabilities beyond those of sql.
This is like a union all in sql. But compare your data step code with the necessary sql code:
proc sql;
create table test as
select * from temp1
union all
select * from temp2;
quit;
and you'll see why it's rarely used when the data step is much more concise. Aside from the fact that the data step has capabilities beyond those of sql.
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!
Still thinking about your presentation idea? The submission deadline has been extended to Friday, Nov. 14, at 11:59 p.m. ET.
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.