The way I've setup my program I extract subsets of data (as tables) from a large dataset. Sometimes these tables are completely empty. Its become a problem since I output these tables onto a pdf and I can sometimes have a number of empty tables.
My question is, is there a way to recognise that the entire table is empty so I could skip outputing this table and go to the next?
there is a macro in the SAS Autocall library called obsnvars which returns the number of observations and number of variables as values of macro variables that you can then test and take action based on the values. snippet from some code where it is in use here
%if &nobs GT 0
proc sql noprint;
create table max_date as
"&&tablename&i" length=50 as table_name
,max(extracteddate) as max_extracteddate