Date: Mon, 15 Jun 2009 14:03:08 -0400
Reply-To: Toby Dunn <tobydunn@HOTMAIL.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Toby Dunn <tobydunn@HOTMAIL.COM>
Subject: Re: adding repeated information
Data Need ( Drop = Minute Date ) ;
Set Have ( Obs = 1440 ) ;
By Animal ;
If First.Animal Then Minute = 0 ;
Minute + 1 ;
Date = DHMS( '01Jan2009'd , 0 , Minute , 0 ) ;
Day = Day( DatePart( Date ) ) ;
Hour = Hour( Date ) ;
Run ;
On Mon, 15 Jun 2009 10:05:00 -0700, nuria <nchapinal@YAHOO.COM> wrote:
>I have a file that has 2 columns: animal and reading.
>I have 100 animals and I recorded a parameter from them every minute
>for 9 days. So for each animal I have 9*1440 observations. I want to
>add a column called "day" that goes from 1 to 9, and a column called
>"hour" that goes from 0 to 23. The readings are sorted in the right
>way, so the first 60 observations for each animal correspond to day 1
>and hour 0. How can I do it automatically? I know there are a few
>animals that have an incomplete dataset because the device stopped
>recording before planned....
>
>Thanks in advance!
|