Goodmorning,
please I remember it's possible to have a PROC SQL with a condition WHERE who put data in two different files as here below:
PROC SQL
CREATE TABLE white black;
a.*
…..
where color eq "white" or "black";
run;
Can you confirm and give me the right program format?
Tnks.
Tecla
SQL cannot create more than one table in a single action. You need to run a separate create table for each newly created table.
If you want to create more than one dataset from one existing dataset, SQL is the worst tool, use a data step instead, as you only need one pass through the input.
What is your goal here?
I have a table wher i put conditions wit where , at last my new table contains only data that replay to conditions and I loose every Others, I need to have a table with data that don't replay to where conditions….
Tnks!!!
I think what you want to do is this.
proc sql;
create table white as
select * from have
where color eq 'white';
create table black as
select * from have
where color eq 'black';
quit;
Or with a data step
data white black;
set have;
if color='white' then output white;
else if color='black' then output black;
run;
Tnks for your kindly replay.
SQL cannot create more than one table in a single action. You need to run a separate create table for each newly created table.
If you want to create more than one dataset from one existing dataset, SQL is the worst tool, use a data step instead, as you only need one pass through the input.
Tnks for your kindly replay !!!
Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!
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.