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 (January 2010, week 3)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Thu, 21 Jan 2010 10:49:29 -0800
Reply-To:     yz <yulongzh@GMAIL.COM>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         yz <yulongzh@GMAIL.COM>
Organization: http://groups.google.com
Subject:      Re: comparing values
Comments: To: sas-l@uga.edu
Content-Type: text/plain; charset=ISO-8859-1

For the code the below, the by statement has two variables, if you change the order of the two variables from "name NUM" to "NUM name", the result would be different. can you illuminate why? thanks,

On Jan 20, 4:11 pm, fdez...@GMAIL.COM (Daniel Fernández) wrote: > here my solution comes: > > data have; > input Num Name $16.; > cards; > 0012 Purple > 0012 Pur ple > 0255 black > 0263 black > 0154 orange > 0154 orunge > 0156 orange > ; > run; > > data need; > set have; > by name NUM notsorted; > if not first.name OR not last.name then delete; > run; > > Daniel Fernandez. > Barcelona. > > 2010/1/20 Sdlentertd <sdlente...@gmail.com>: > > > > > I need to find out which numbers are the same with different names and > > output them for additional analysis or renaming: > > I have this dataset: > > > Num Name > > 0012 Purple > > 0012 Pur ple > > 0255 black > > 0263 black > > 0154 orange > > 0154 orunge > > 0156 orange > > > want dataset: > > Num Name > > 0012 Purple > > 0012 Pur ple > > 0154 orange > > 0154 orunge > > 0156 orange > > > Notes: black should be dropped because the names are the same for > > each of corresponding number. orange should be outputed because for > > the same number the name is spelled differently. > > Thank you- Hide quoted text - > > - Show quoted text -


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