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 2025: Register Now

Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
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
  • 597 views
  • 0 likes
  • 4 in conversation