DATA Step, Macro, Functions and more

how to write macro observations into a dataset

Accepted Solution Solved
Reply
Frequent Contributor
Posts: 84
Accepted Solution

how to write macro observations into a dataset

Hi,

how to write macro variable obs into a dataset.

Is there any error in below code.

Proc sql noprint outobs=1;

select name into:bname from sashelp.class;

quit;

%put &bname;

data want;

name = &bname;

run;

Thanks


Accepted Solutions
Solution
‎05-18-2015 02:49 PM
Super User
Posts: 5,091

Re: how to write macro observations into a dataset

You're very close.  Just add double quotes:

name="&bname";

View solution in original post


All Replies
Solution
‎05-18-2015 02:49 PM
Super User
Posts: 5,091

Re: how to write macro observations into a dataset

You're very close.  Just add double quotes:

name="&bname";

☑ This topic is solved.

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

Discussion stats
  • 1 reply
  • 201 views
  • 1 like
  • 2 in conversation