Ok, here you go. 0 indicates no missing data items, >0 is count of missings:
data abcd;
input memname $ name $ libname $;
status2=0;
cards;
class age work
class height work
;
run;
data class;
set sashelp.class;
if _n_ in (3,4) then age =.;
run;
data _null_;
set abcd;
call execute(cat('proc sql;
update abcd
set status2=(select sum(case when ',strip(name),' is null then 1 else 0 end) from ',catx('.',libname,memname),') where libname="',strip(libname),'" and memname="',strip(memname),'" and name="',strip(name),'";
quit;'));
run;
... View more