i want a create a macro variable by taking all the values of the variable into the macro variable
ex;-
data ds1;
set sashelp.class;
run;
Data belongs in datasets, not in macro variables.
To create macro variables in data steps, use the call symput() subroutine.
@bismilla wrote:
i want a create a macro variable by taking all the values of the variable into the macro variable
ex;-
data ds1;
set sashelp.class;
run;
Do want all values of one variable stored in a macro variable or do you want all values of all variables in one macro-variable?
As said by @Kurt_Bremser, storing data in macro variables is almost always not necessary and you will be forced to write more code, than necessary.
This is, by the way, one of the very, very rare cases, in which using proc sql is justified:
proc sql noprint;
select Name
into :NameList separated by ' '
from sashelp.class
;
quit;
Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!
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.
Ready to level-up your skills? Choose your own adventure.