The function cmiss can be used to subset a data set by excluding missing values.
Here is an example.
data t1;
length n1 n2 8 c1 c2 $1;
infile cards truncover;
input n1 n2 c1 c2 ;
do i = 1 to 1000;
output;
end;
drop i;
cards;
1 2 a b
. .
3 . c d
;
/* proc print; run;*/
****if all variables have missing then delete***;
data t2;
set t1;
if cmiss(of _all_) <4 ;
run;
****log***
473 data t1;
474 length n1 n2 8 c1 c2 $1;
475 infile cards truncover;
476 input n1 n2 c1 c2 ;
477 do i = 1 to 1000;
478 output;
479 end;
480 drop i;
481 cards;
NOTE: The data set WORK.T1 has 3000 observations and 4 variables.
NOTE: DATA statement used (Total process time):
real time 0.09 seconds
cpu time 0.01 seconds
485 ;
486
487 /* proc print; run;*/
488
489 ****if all variables have missing then delete***;
490 data t2;
491 set t1;
492 if cmiss(of _all_) <4 ;
493 run;
NOTE: There were 3000 observations read from the data set WORK.T1.
NOTE: The data set WORK.T2 has 2000 observations and 4 variables.
NOTE: DATA statement used (Total process time):
real time 0.03 seconds
cpu time 0.03 seconds