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 !!!
Available on demand!
Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.
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.
Select SAS Training centers are offering in-person courses. View upcoming courses for: