Date: Fri, 30 Jul 2004 08:29:03 +0200
Reply-To: "Groeneveld, Jim" <jim.groeneveld@VITATRON.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: "Groeneveld, Jim" <jim.groeneveld@VITATRON.COM>
Subject: Re: Data extraction from column
Content-Type: text/plain; charset="iso-8859-1"
Hi Nidal,
I think you want a sequence number per ID, is that right? If so then take care your dataset has been sorted according to ID (and other relevant variables) and (*untested*):
DATA New;
SET Old; BY ID;
IF (FIRST.ID) THEN Sequence = 0;
Sequence + 1;
RUN;
You may add this code to some other already existing data step.
If this is not what you wanted, then please clarify.
Regards - Jim.
--
. . . . . . . . . . . . . . . .
Jim Groeneveld, MSc.
Biostatistician
Science Team
Vitatron B.V.
Meander 1051
6825 MJ Arnhem
Tel: +31/0 26 376 7365
Fax: +31/0 26 376 7305
Jim.Groeneveld@Vitatron.com
www.vitatron.com
My computer says 'beep'. What's wrong with that? It's talking too much!
[common disclaimer]
-----Original Message-----
From: Nidal AL-Huniti [mailto:nidal-al-huniti@UIOWA.EDU]
Sent: Thursday, July 29, 2004 22:47
To: SAS-L@LISTSERV.UGA.EDU
Subject: Data extraction from column
Hi,
I am trying to extract a new variable based on patient ID. Sample data looks
like this
ID age liver function
123456 3.0 150
123456 4.0 160
123456 4.6 170
..
I want to create a new variable based on ID #. So for a given ID # I
would have only ONE # (subject #)
Your help is greatly appreciated,
Nidal