Date: Thu, 17 Sep 2009 14:48:46 -0700
Reply-To: "Schwarz, Barry A" <barry.a.schwarz@BOEING.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: "Schwarz, Barry A" <barry.a.schwarz@BOEING.COM>
Subject: Re: proc sort
In-Reply-To: <4994e3e9-fe26-431f-bc54-40034a7a3789@m20g2000vbp.googlegroups.com>
Content-Type: text/plain; charset="US-ASCII"
Sort by dates ascending and data descending.
In a data step, every time first.dates is true, set a retained count to
0. For each input record, increment count. If it is 10 or less, output
the record.
-----Original Message-----
From: hd
Sent: Thursday, September 17, 2009 7:57 AM
To: SAS-L@LISTSERV.UGA.EDU
Subject: proc sort
Dear all,
I am a little stuck on this
I have a dataset
dates Country data
11/30/2001 USA 1400
11/30/2001 Belgium 300
12/31/2001 Canada 500
12/31/2001 Peru 300
I would like to pick the top 10 countries sorted by data in descending
order, for each date.
|