Date: Tue, 15 Dec 2009 02:16:30 -0800
Reply-To: siyuan li <lisiyuan0753@GMAIL.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: siyuan li <lisiyuan0753@GMAIL.COM>
Organization: http://groups.google.com
Subject: Re: how to find out the last obs
Content-Type: text/plain; charset=GB2312
On 12月15日, 下午3时09分, Patrick <patrick.mat...@gmx.ch> wrote:
> I assume you also want to summarise the trades per month.
> Try this:
>
> data have;
> input date:yymmdd10. trade;
> datalines;
> 1991-02-10 15
> 1991-02-16 25
> 1991-06-25 36
> 1992-02-25 23
> 1992-06-12 54
> ;
> run;
> proc sql;
> select year(date) as year, month(date) as month, sum(trade) as trade
> from have
> group by year,month
> ;
> quit;
>
> HTH
> Patrick
thanks very much
|