%macro chk(lib=,varlist=);
proc sql noprint;
select distinct catx(".",libname,memname) into : datalist separated by " "
from dictionary.columns
where libname = %upcase("&lib") and %upcase(&varlist) = upcase("&varlist");
quit;
data test1;
set &datalist;
run;
proc print data=work.test1;run;
%mend;
%chk(lib=ssp,varlist=name ID height);
my above example searches specific variables in varlist parameter in all DataSets in the specific library grp and appends them. i have 2 DS with all the variables but only the values from the 1 DS is selected & not frm DS 2 & also gives a error. &datalist symbolic reference not found....