Hello guys.
DICTIONARY.COLUMNS would be the most simple and straightforward way.
I still prefer the PROC CONTENTS procedure, since when using it intensively (many columns, many tables) it is a lot more fast against the querying DICTIONARY tables method.
I think this will do what you need:
proc contents data = A out = _A_CONTENTS noprint;
run;
/* only necessary if you need to maintain the column order */
proc sort;
by VARNUM;
run;
/* load NAMEs to myPredictors macro */
%let myPredictors=;
data _null_;
set _A_CONTENTS;
/* build myPredictors list with NAMES separated by space char */
call symput('myPredictors',catx(' ',symget('myPredictors'),NAME));
run;
/* result */
%put &myPredictors;
Greetings from Portugal.
Daniel Santos at
www.cgd.pt