No need for a loop - @kiranv_'s good idea of "select ... from dictionary.tables" can be accompanied by a second statement in the same proc sql.
data mylib.one work.two;
set sashelp.class;
stop;
run;
proc sql noprint;
select distinct catx('.',libname,memname)
into :droplist separated by ','
from dictionary.tables
where libname in ('WORK','MYLIB') and nlobs=0;
drop table &droplist;
quit;
However, @Ankur32's description in another forum suggests that "blank dataset" does NOT mean nlobs=0, but rather a dataset in which nlobs may be > 0 but that all the variables are always missing. Frankly I think "blank" should mean no rows of data. But if the alternative meaning is used, then the "nlobs=0" criterion will not work. One would have to scan all datasets in a library, to see which (among those with nlobs>0), if any, have only missing values.
... View more