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 (August 2009, week 4)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Tue, 25 Aug 2009 09:06:20 -0700
Reply-To:     olivesecret <olivesecret@GMAIL.COM>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         olivesecret <olivesecret@GMAIL.COM>
Organization: http://groups.google.com
Subject:      Re: problems in data step
Comments: To: sas-l@uga.edu
Content-Type: text/plain; charset=ISO-8859-1

On Aug 25, 11:43 am, billyk <sas...@gmail.com> wrote: > On Aug 25, 11:09 am, olivesecret <olivesec...@gmail.com> wrote: > > > Hi I have a data set consisting of ID, response variable y and others. > > There are several obs for each ID. How can I remove those IDs with > > same values on y? In other words, if for one ID, all of obs have the > > same value of y, then I remove all of obs belonging to this ID. Thanks > > for any input! > > Try this.... > > proc sort data=old; by id y; run; > data new; > set old; > by id y; > if first.y; > run;

Your way will keep obs with unique y for each ID. This is different from what I want. What I need is, remove those IDs which have the same y in all of its obs.


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