How to find observation with no missing value for any variable in SAS?

sas
missing_values

#1

Hi,

I have a data set and it has 25 variables. Now I want to sub-set records with no missing values for any variables. Here I need to write Where statement with each variable name as

Where Var1 ne . and Var2 ne . and Var3 ne . to Var25 ne .

Can you suggest me the simple way to do this?

Thanks


#2

Hi,

Use a macro instead. Please refer to the code below -

%macro drop_nulls();
data (op dataset name);
set(ip dataset name)(where=(%do i=1 %to 24; var&i. ne . and end; var25 ne.));
run;
%mend;
%drop_nulls();