*Output the names of all datasets in work library to a dataset;
ods output members=name;
ods listing close;
proc datasets lib=work MEMTYPE=data;
quit;
ods output close;
ods listing;
*Create macro variables to save these filenames;
data _null_;
set name end=last;
call symput ('file'||strip(put(num,8.)),name);
if last then call symput ('file_num',num);
run;