DATA Step, Macro, Functions and more

create two macro variables in proc sql

Accepted Solution Solved
Reply
Frequent Contributor
Posts: 84
Accepted Solution

create two macro variables in proc sql

Hi,

Why this code is giving error? How can we create two macro variables through into option.

Proc sql noprint outobs=1;

select name into:bname, age into:bage  from sashelp.class;

quit;

%put &bname &bage;

Thanks...


Accepted Solutions
Solution
‎05-18-2015 01:55 PM
Respected Advisor
Posts: 4,641

Re: create two macro variables in proc sql

Because the code hasn't the proper syntax, which is :

Proc sql noprint;

select name, age into:bname, :bage  from sashelp.class;

quit;

%put &bname &bage;

Which record do you want anyway?

PG

PG

View solution in original post


All Replies
Solution
‎05-18-2015 01:55 PM
Respected Advisor
Posts: 4,641

Re: create two macro variables in proc sql

Because the code hasn't the proper syntax, which is :

Proc sql noprint;

select name, age into:bname, :bage  from sashelp.class;

quit;

%put &bname &bage;

Which record do you want anyway?

PG

PG
Frequent Contributor
Posts: 84

Re: create two macro variables in proc sql

Thanks for reply. This is the generic question i have asked. i will put conditions in where clause.

☑ This topic is SOLVED.

Need further help from the community? Please ask a new question.

Discussion stats
  • 2 replies
  • 197 views
  • 1 like
  • 2 in conversation