proc sql;
describe table dictionary.tables;
quit;
proc sql;
select count(distinct memname) as nsubj into :nsubj from dictionary.tables where libname='ADAM102';
quit;
%put &nsubj;
options mprint;
proc sql;
select distinct memname into :dsna separated by " " from dictionary.tables where libname='ADAM102';
quit;
%put &dsna;
options mprint;
%macro loop;
%let i=0;
%do %until (&i>=&nsubj);
%let ds1=%scan(&dsna,&i+1,%str( ));
%put &ds1;
%let i=%eval(&i+1);
%end;
%mend loop;
%put %loop;