BookmarkSubscribeRSS Feed
karaheller20
Calcite | Level 5

I am looking for an impressive way to delete the missing observations in my variable ev_count. I know I could just list the options 0,1,2,3 and = them to themselves and then put other delete. But I have to submit my code with my project and cannot find a better more time efficient way to just delete the whole row when ev_Count is missing. 

3 REPLIES 3
novinosrin
Tourmaline | Level 20

Are you meaning 

if missing(ev_count) then delete;
PaigeMiller
Diamond | Level 26
data want;
   set have;
   if missing(ev_count) then delete;
run;
--
Paige Miller
PeterClemmensen
Tourmaline | Level 20

So you simply want to delete observations whare the variable ev_count is missing?

 

data have;
input ev_count;
datalines;
1
.
2
.
;

data want;
    set have;
    if not missing(ev_count);
run;

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

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
  • 3 replies
  • 325 views
  • 0 likes
  • 4 in conversation