Hello,
You can check for missing values using proc sql:
proc sql noprint; select max(&varname) into :max_value from &dsname; quit;
and afterwards just check the value of the newly created macro variable:
%if &max_value= or &max_value=. %then %do; %put &varname has only missing values;%end;
... View more