DATA Step, Macro, Functions and more

Proc SQL Query to create and store macro value in table

Reply
Occasional Contributor
Posts: 13

Proc SQL Query to create and store macro value in table

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

Super User
Posts: 19,870

Re: Proc SQL Query to create and store macro value in table

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;
Ask a Question
Discussion stats
  • 1 reply
  • 681 views
  • 2 likes
  • 2 in conversation