BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.

i need to find a list of variables with all missing values in a dataset.

 

Can anyone please help me out ?

 

1 ACCEPTED SOLUTION
9 REPLIES 9
PeterClemmensen
Tourmaline | Level 20

What do you want to do with those variables? Drop them, put them in a data set or something third?

VinitvictorCorr
Quartz | Level 8
lets say drop them.. list of these variables is important to me
PeterClemmensen
Tourmaline | Level 20

Are the variables of interest all numeric, character or a mix of the two?

VinitvictorCorr
Quartz | Level 8
mixed..i would also love to know which are character and which are numeric. But i can get a list of that from sashelp.vcolumn.. so the emphasis is on missing variables
VinitvictorCorr
Quartz | Level 8
Thank You:)... but is there any other way past arrays:P
PeterClemmensen
Tourmaline | Level 20

Sure thing 🙂

 

data have;
input var1 var2 var3 $ var4 $;
datalines;
1 . A .
. . B .
3 . . .
;

ods output nlevels=nlvs(where=(nnonmisslevels eq 0));
proc freq data=have nlevels;
    ods select nlevels;
run;

proc sql noprint;
    select tablevar into :drop separated by ' '  from nlvs;
quit;

data want;
    set have(drop=&drop);
run;
VinitvictorCorr
Quartz | Level 8

this is perfect...thanks 🙂

 

PeterClemmensen
Tourmaline | Level 20