Hi Jay, I made a few modifications on the original macro based on the clause "Count(Var)" witch counts the number of non-null values of the Var variable. So when Count(var) = 0 means that ALL values of the variable are nulls or missing: %macro report(lib); %let lib=%upcase(&lib); data report_&lib; length Library_Name $8 Dataset_Name $32 Column_Name $32; stop; run; proc sql noprint; select distinct count(distinct memname), memname into :N_Tables, :Tables separated by ' ' from sashelp.vcolumn where libname="&lib" ; quit; %let cnt_tables=1; %do %while (&cnt_tables <= &n_tables); %let dataset=%Scan(&tables,&cnt_tables); proc sql noprint; select distinct count(name), name into :N_Vars, :Variables separated by ' ' from sashelp.vcolumn where libname="&lib" and memname="&dataset" ; quit; %let cnt_Vars=1; %do %while (&cnt_vars <= &n_vars); %let var=%scan(&variables,&cnt_Vars); proc sql noprint; select count(&var) into :nulls from &lib..&dataset ; quit; %if &nulls=0 %then %do; data newreg; length Library_Name $8 Dataset_Name $32 Column_Name $32; library_name="&lib"; dataset_name="&dataset"; column_name="&var"; run; proc append base=report_&lib data=newreg; run; %end; %let cnt_vars = %eval(&cnt_vars + 1); %end; %let cnt_tables = %eval(&cnt_tables + 1); %end; %mend report; %report(sasuser) Regards,
... View more