Date: Tue, 18 Jul 2006 13:27:11 -0700
Reply-To: BK <byronkirby@GMAIL.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: BK <byronkirby@GMAIL.COM>
Organization: http://groups.google.com
Subject: Re: Ranges-tiers-date
In-Reply-To: <1153250409.922713.286220@h48g2000cwc.googlegroups.com>
Content-Type: text/plain; charset="iso-8859-1"
Assuming that I'm reading your question right, here is the most basic
approch... (code not run.)
data Ds2;
set Ds1;
if date LT '22May2005'd then DateCat="Prior";
else if date GT '22May2005'd then DateCat="Post"; *** not there is not
Cat for the date'22May2005'd
if CHGS >100 then tier=1;
else if CHGS >200 then tier=2;
Else...
run;
proc sql;
select DateCat, Tier, sum(CHGS)
from Ds2
Group by DateCat, Tier;
quit;
run;
sdlentert@aol.com wrote:
> I have this data:
> dates and $$$
> i need to break down my data before '22May2005'd and after '22May2005'd
> AND
> by tiers: $100, $200, $300, $500, $1000 (SUM)
>
> So the output will look like
> date Tier SUM amount
> '22May2005'd $100 $1,222 (pretend)
> $200 $3,555
> $300 $22,000
>
> data test;
> set sas.sample
> ????
|