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

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
Mastering the WHERE Clause in PROC SQL

SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 9 replies
  • 1003 views
  • 2 likes
  • 2 in conversation