LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous (more recent) messageNext (less recent) messagePrevious (more recent) in topicNext (less recent) in topicPrevious (more recent) by same authorNext (less recent) by same authorPrevious page (February 2000, week 5)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Tue, 29 Feb 2000 11:17:20 -0800
Reply-To:     "Lund, Pete" <Peter.Lund@CFC.WA.GOV>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         "Lund, Pete" <Peter.Lund@CFC.WA.GOV>
Subject:      Re: Creating a sequential number for each observation in a by gro
              up
Content-Type: text/plain; charset="iso-8859-1"

Ellen- You can use the FIRST.varname automatic variable.

data test; set junk; by a;

if first.a then counter = 0; * reset the counter at the beginning of a by group;

counter + 1; * increment counter, implied retain ; run;

HTH-

Pete Lund WA State Caseload Forecast Council (360) 902-0086 voice (360) 902-0084 fax peter.lund@cfc.wa.gov

-----Original Message----- From: EMRAIN [mailto:emrain@AOL.COM] Sent: Tuesday, February 29, 2000 11:19 AM To: SAS-L@LISTSERV.UGA.EDU Subject: Creating a sequential number for each observation in a by group

I need to creat a sequential number (starting at 001) for each observation in a By group. I know there is an easy answer and I am just missing it. Thanks in advance.

Ellen


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