Date: Sat, 26 May 2001 11:26:43 -0400
Reply-To: Jay Weedon <jweedon@EARTHLINK.NET>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Jay Weedon <jweedon@EARTHLINK.NET>
Subject: Re: Help: Sorting a SAS datastep array.
Content-Type: text/plain; charset=us-ascii
Use the ORDINAL function. For instance,
provides the 4th lowest value, &
provides the 2nd highest value.
On 26 May 2001 05:16:50 GMT, firstname.lastname@example.org (RICH0850) wrote:
>I have a problem which may have been answered before, if so please forgive me.
>I need to sort a SAS data step array. SCL actually has a function to do this
>(ASORT), but as far as I know, no equivalent exists for the data step.
> ARRAY BOB (15) A1-A15;
> INPUT A1-A15;
>1 9 5 8 4 9 9 4 3 10 11 4 7 5 3
>I need to find the largest 5 guys and the smallest 5 guys in A1-A15. My problem
>may not actually need a sort (although a sort would be useful) but just some
>means of cycling through the array and finding the top 5 and bottom 5.