LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous messageNext messagePrevious in topicNext in topicPrevious by same authorNext by same authorPrevious page (September 2010, week 2)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Fri, 10 Sep 2010 17:26:12 -0400
Reply-To:     Tom Abernathy <tom.abernathy@GMAIL.COM>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         Tom Abernathy <tom.abernathy@GMAIL.COM>
Subject:      Re: Please ignore my prevoius post ( made a mistake there). I
              Need To Exclude Rcords Wth All missing values Please help me.

If you want to exclude observations where the four character variables are ALL missing then this syntax is pretty easy to type and understand:

if (' ' = as || de || sw || er) then delete;

On Fri, 10 Sep 2010 17:18:26 -0400, Chang Chung <chang_y_chung@HOTMAIL.COM> wrote:

>On Fri, 10 Sep 2010 16:29:05 -0400, Tom Smith <need_sas_help@YAHOO.COM> >wrote: > >>I have a following dataset with four character variables: subjet, as, de, >>sw, er. I need >>to excluse those observations in result dataset where all variable has >>missing values. >>I tried with CMISS function. but it did not work since I guess my sas is >>8.1, can not use a lot of >>fuction. May be we need to use a datastep. >> >>subjet as de sw er >>------ --- -- -- -- >>101 earth moon sun jupitar >>101 >>101 moon jupitar >>103 >>102 Planet fitness >>102 >>103 LA PA JA SA >>103 oper bus car >> >>The result should be as below: >> >>subjet as de sw er >>------ --- -- -- -- >>101 earth moon sun jupitar >>101 moon jupitar >>102 Planet fitness >>103 LA PA JA SA >>103 oper bus car > >/* test data */ >data one; > input id (a b c d) ($); >cards; >1 w x y z >2 . . . . >3 . x y . >; >run; > >/* i would do this in sas 9 */ >data two; > set one; > where cmiss(a, b, c, d)<4; >run; > >/* this should work with sas 8. ^ means NOT */ >data three; > set one; > if ^(a=" " and b=" " and c=" " and d=" "); >run; > >/* check */ >proc print data=three noobs; >run; >/* on lst >id a b c d > 1 w x y z > 3 x y >*/


Back to: Top of message | Previous page | Main SAS-L page