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 2008, week 5)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Tue, 30 Sep 2008 11:08:34 -0700
Reply-To:     Akshaya <akshaya.nathilvar@GMAIL.COM>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         Akshaya <akshaya.nathilvar@GMAIL.COM>
Organization: http://groups.google.com
Subject:      Re: selecting a record when any one variable is not missing
Comments: To: sas-l@uga.edu
Content-Type: text/plain; charset=ISO-8859-1

A more simplified solution using SUM function:

Data test2; set test; if sum(of a--h)^=.; Run;

Thanks! Akshaya

On Sep 30, 12:53 pm, Vasyl Aleksenko <alekse...@gmail.com> wrote: > Hi, > > Not the best solution, though: > > data get (drop = i ct1-ct8 Tot); > set have; > array variables[*] a b c d e f g h; > array cnt[*] ct1-ct8 /* counters */; > > do i = 1 to dim(variables); > if variables[i] > . then > cnt[i] = 1; > end; > > Tot = sum(of ct1-ct8); > if Tot = 8 or Tot = .; > > run; > > On Sep 30, 11:44 am, sas...@GMAIL.COM (sas biology) wrote: > > > Hi Group, > > > I have data that are similar to the one given below > > > * > > > data* test; > > > input id a b c d e f g h; > > > cards; > > > 1 0 1 1 1 1 1 1 0 > > > 2 1 0 0 0 1 0 1 1 > > > 3 . 1 0 1 1 1 0 1 > > > 4 1 0 0 0 1 1 1 0 > > > 5 0 . . . 1 . 0 0 > > > 6 . . . . . . . . > > > ; > > * > > > run*; > > > What I need to do is to select the records when any one variable is not > > having a missing value. in other terms I need to exclude the records where > > all the variables have missing values(all records except the 6th in the > > above example). How can I do that? > > > Thank you > > > SB


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