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 2011, week 3)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:   Fri, 19 Aug 2011 23:05:08 -0400
Reply-To:   Arthur Tabachneck <art297@ROGERS.COM>
Sender:   "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:   Arthur Tabachneck <art297@ROGERS.COM>
Subject:   Re: Groupings --- Is this correct?
Comments:   To: SUBSCRIBE SAS-L Anonymous <randistan69@HOTMAIL.COM>

Sure, but you don't need the line that starts with if _n_ eq 1. It doesn't hurt, but you'll get the same result with or without it.

Art ------ On Fri, 19 Aug 2011 22:09:46 -0400, Randy <randistan69@HOTMAIL.COM> wrote:

>my data set is as follows: > >ID >A >A >A >B >B >B >B >B >C >C > >What I need is > >ID ID_Group >A 1 >A 1 >A 1 >B 2 >B 2 >B 2 >B 2 >B 2 >C 3 >C 3 > >The code I wrote is as follows: > >Data Need ; set Have; >by ID; >If _N_ = 1 then ID_Group = 0 ; >If first.ID then ID_Group +1 ; >run;


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