Hi:
Since you are already using a macro program, I'd recommend that you investigate the use of DICTIONARY tables or their SASHELP equivalents. There have been MANY previous forum postings on the use of DICTIONARY tables to select variables (and tables) for processing and many MORE user-group papers on the topic.
cynthia
To get you started:
[pre]
ods listing;
options nocenter ls=175 nodate nonumber;
title 'SQL uses DICTIONARY.COLUMNS';
proc sql;
select libname, memname, name, type, format, label
from dictionary.columns
where (libname = 'SASHELP' and memname = 'PRDSALE');
quit;
title 'PROC PRINT uses SASHELP.VCOLUMN';
proc print data=sashelp.vcolumn noobs;
where (libname = 'SASHELP' and memname = 'PRDSALE');
var libname memname name type format label;
run;
title;
[/pre]