> Unfortunately, I need to use this list to do things
> like create define statements for proc report. I
> really need the list stored in a macro variable that
> can be referenced
Unfortunate? What information do you need to supply for the DEFINE statements, you may be able to write generic define statements. Consider the following...
[pre]
proc sql noprint nowarn outobs=5 /*or 5*/;
select name into :names separated by ' '
from dictionary.columns
where libname eq 'SASHELP' and memname eq 'CLASS'
order by varnum
;
quit;
run;
%put NOTE: NAMES=&names;
proc report data=sashelp.class(keep=&names) nowd list;
columns &names;
define _all_ / group;
define _numeric_ / format=comma12.;
define _character_ / format=$10.;
run;
[/pre]
Or if that is inadequate you could "code gen" define statements in a way similar to the variable list &NAMES. A bit more complicated by doable.