LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous messageNext messagePrevious in topicNext in topicPrevious by same authorNext by same authorPrevious page (September 2009, week 3)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
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.


Back to: Top of message | Previous page | Main SAS-L page