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 (May 2004, week 2)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Fri, 14 May 2004 09:36:09 -0400
Reply-To:     Bruce Johnson <bjohnson@SOLUCIENT.COM>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         Bruce Johnson <bjohnson@SOLUCIENT.COM>
Subject:      Re: An easy one for you
Comments: To: pete <twiddler81@HOTMAIL.COM>
Content-Type: text/plain; charset="us-ascii"

If you've sorted it, the easy, non-confrontational way to do it is:

Data top; set fulldata; by descending var; if _n_ < 10001; Run;

If you are truly concerned about a tie, then look into Proc Rank...

________________________________ Bruce A. Johnson bjohnson@solucient.com

-----Original Message----- From: SAS(r) Discussion [mailto:SAS-L@LISTSERV.UGA.EDU] On Behalf Of pete Sent: Friday, May 14, 2004 6:22 AM To: SAS-L@LISTSERV.UGA.EDU Subject: An easy one for you

All sas dudes,

I have a dataset with over 1 million records of which i need to output the top 1000 based on a numerical 'by' variable. After it has been sorted in decending order on the 'by' variable (which i can do) how would I go about outputting the top 1000 records?

Also what would happen if there was a tie for the 1000th place?

Cheers for the help, Richard This message is a private communication. It may contain information that is confidential and legally protected from disclosure. If you are not an intended recipient, please do not read, copy or use this message or any attachments, and do not disclose them to others. Please notify the sender of the delivery error by replying to this message, and then delete it and any attachments from your system. Thank you, Solucient LLC (rev eXclaimer 2x)


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