Hi All,
I am trying to create a macro variable using Proc SQL and store it in a table. but I am getting the above warning
WARNING: INTO clause is ignored in the CREATE TABLE statement.
proc sql;
create table t as select count(*) as c into :car from sashelp.cars;
quit;
any help would be appreciated.
Thank you,
Nitesh
You can either create a macro or store it into a table, not both in a PROC SQL step.
You can use two separate steps but it doesn't make a lot of sense given your current query, since you have a single value which is accessible in the macro variable.
proc sql noprint;
create table t as
select count(*) as c
from sashelp.cars;
select c into :car from t;
quit;
Try this query to initialize the macro variable.
proc sql;
select count(*) as c
into :car
from sashelp.cars;
quit;
%put &car.;
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.