Date: Fri, 14 May 2004 21:10:00 -0400
Reply-To: Lou <lpogodajr292185@COMCAST.NET>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Lou <lpogodajr292185@COMCAST.NET>
Subject: Re: An easy one for you
"Bruce Johnson" <bjohnson@SOLUCIENT.COM> wrote in message
news:B1EA9C6C7151EB42B242A4EFA0D0A71E019F6A8B@aaexchange01.HEALTH.AD...
> 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...
If you're going to output the first 1,000 observations, then you don't need
the BY statement.
>
> ________________________________
> 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)
|