%if %UPCASE(&Filter) EQ _NULL_ %then %do;
proc sql noprint;
select count(distinct memname) into :DET_EmptyTableNum
from DET_temp
where UPCASE(libname) EQ UPCASE("&LibName") AND nobs EQ 0
%if &DataSet NE %STR() %then %do;
AND UPCASE(memname) in (&DataSet_Quote)
%end;
;
quit;
%if &DET_EmptyTableNum EQ 0 %then %do;
%put NOTE: There is no empty table or dataset in the specified library, therefore none of table is dropped.;
%goto exit;
%end;
%else %do;
proc sql noprint;
select distinct memname into :DET_EmptyTableList separated by ' '
from DET_temp
where UPCASE(libname) EQ UPCASE("&LibName") AND nobs EQ 0;
quit;
%end;
%end;
%else %if (%SYSFUNC(FIND(&Filter,_)) NE 0) OR (%SYSFUNC(FIND(&Filter,%)) NE 0) %then %do;
proc sql noprint;
select count(distinct memname) into :DET_EmptyTableNum
from DET_temp
where UPCASE(libname) EQ UPCASE("&LibName") AND
UPCASE(memname) like UPCASE("&Filter") AND nobs EQ 0
%if &DataSet NE %STR() %then %do;
AND UPCASE(memname) in (&DataSet_Quote)
%end;
;
quit;
%if &DET_EmptyTableNum EQ 0 %then %do;
%put NOTE: There is no empty table or dataset in the specified library, therefore none of table is dropped.;
%goto exit;
%end;
%else %do;
proc sql noprint;
select distinct memname into :DET_EmptyTableList separated by ' '
from DET_temp
where UPCASE(libname) EQ UPCASE("&LibName") AND
UPCASE(memname) like UPCASE("&Filter") AND nobs EQ 0;
quit;
%end;
%end;