If you are trying to get rid of lines where ALL variables are missing, this is pretty simple:
data have; set sashelp.class; if _N_ in (2,5,8,13) then do; call missing(of _numeric_); end; if _N_ in (5,6,8,12) then do; call missing(of _character_); end; run; data want; set have; if compress(cats(of _all_),'.')=' ' then delete; run;
Instead of compressing, you can also use OPTIONS MISSING=' '; in advance.
If you want to delete ALL rows with ANY missing value, you can use the NMISS / CMISS functions.
data want; set have; if nmiss(of _numeric_) > 0 then delete; run;
or
data want; set have; if nmiss(of _numeric_) + cmiss(of _character_) > 0 then delete; run;
for all char + numeric variables.
Joe
source share