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 14:29:10 -0500
Reply-To:     "Miller, Scott" <scott.miller@CAMCARE.COM>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         "Miller, Scott" <scott.miller@CAMCARE.COM>
Subject:      Re: Creating a sequential number for each observation in a by gro
              up
Comments: To: EMRAIN <emrain@AOL.COM>
Content-Type: text/plain; charset="iso-8859-1"

first sort the data by your 'by' variable...

proc sort; by a; run;

then us the _n_ to get your sequential numbering

idnum=_n_;

Scott D. Miller, M.A.

Medical Informatics Analyst/SAS Programmer Center for Health Services and Outcomes Research CAMCARE Health Education and Research Institute 304 388-9918

"Every good scientist is one part B.F. Skinner and one part P.T. Barnum"

Another Month Ends...All Targets Met...All Systems Working... All Staff Eager and Enthusiastic...All Pigs Fed and Ready to fly

-----Original Message----- From: EMRAIN [mailto:emrain@AOL.COM] Sent: Tuesday, February 29, 2000 2:19 PM 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