This array solution skips the need to query the metadata, no?

data two;
set temp;
array charvars{*} $ _character_;
miss=cmiss(of _character_);
altmiss = cmiss(of charvars(*)); /* <-- Alt approach for counting missing */
nonmiss=dim(charvars) - miss;
run;