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;
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!
Still thinking about your presentation idea? The submission deadline has been extended to Friday, Nov. 14, at 11:59 p.m. ET.
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.