Date: Fri, 9 Feb 2001 13:30:08 -0500
Reply-To: "Shilling, Brian [PRI]" <BShillin@PRIUS.JNJ.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: "Shilling, Brian [PRI]" <BShillin@PRIUS.JNJ.COM>
Subject: Re: Frequency by season
Content-Type: multipart/alternative;
Ed,
Try this.
Set up to variables for each season, one beginning and one end. For this
example, lets use winter.
winstart = 01FEB2000;
winend = 28FEB2001;
then use the INTCK function to figure out the number of days in the season,
like so:
windays = INTCK('days',winstart,winend);
Hope this helps!
Brian
> -----Original Message-----
> From: Eduard Streltsov [SMTP:estreltsov@eurocomix.net]
> Sent: Friday, February 09, 2001 1:15 PM
> To: SAS-L@LISTSERV.UGA.EDU
> Subject: Frequency by season
>
> Hi,
>
> I've got a SAS file DATES with a variable DATE which is a SAS date. The
> values of DATE span several years across the observations. I also have
> four seasons defined as:
>
> winter -> 01dec thru feb
> spring -> 01mar thru may
> summer -> 01jun thru aug
> autumn -> 01sep thru nov
>
> What I have to do is print number of dates that fall into each season
> (frequency by season) like this:
>
> winter=123 spring=456 summer=789 autumn=258
>
> If a season has nothing in it, a missing (.) should print. I've come up
> with a pretty ugly pile of if-then-elses. I will appreciate any
> professional, elegant example of how to do it.
>
> Thanks, Ed
>
> _____________________________________________________________
> Get you @eurocomix.net at http://eurocomix.com for FREE !!!
[text/html]
|