Date: Fri, 3 Nov 2006 16:53:32 GMT
Reply-To: kenneth_m_lin@SBCGLOBAL.NET
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: kenneth_m_lin@SBCGLOBAL.NET
Organization: SBC http://yahoo.sbc.com
Subject: Re: counter variable
He did. But the "if patient ..." statement would always return true.
""Schwarz, Barry A"" <barry.a.schwarz@BOEING.COM> wrote in message
news:455E5B258922154FBE497F58237915C601315476@XCH-NW-8V2.nw.nos.boeing.com...
> Show your code so we can see what is wrong.
>
> -----Original Message-----
> From: phillyj [mailto:jessica.donato@GMAIL.COM]
> Sent: Thursday, November 02, 2006 3:44 PM
> To: SAS-L@LISTSERV.UGA.EDU
> Subject: counter variable
>
> Hello all! I would be very grateful if someone can help me with this
> program:
>
> I want to create a counter variable that counts 1, 2, 3, etc. for each
> observation of each patient. When a new patient arrives I want it to
> start back at 1. The below program was created but it is outputting all
> the same number for each patient as opposed to a count per patient.
> make sense?
>
> data newOutcomes ;
> set Outcomes ;
> by patient;
> If patient Then record+1 ;
> run;
>
> For instance, this program is outputing
>
> patient record I would like......
> patient record
> 1047 1
> 1047 1
> 1047 1
> 1047 2
> 1047 1
> 1047 3
> 1048 2
> 1048 1
> 1048 2
> 1048 2
> 1048 2 , etc
> 1048 3, etc.
>
> I added a first.patient do loop but it is extracting only the first
> patient then... thanks for your help with this.....
|