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 !!!
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
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.