Date: Mon, 31 Jan 2000 14:08:15 -0500
Reply-To: "Fehd, Ronald J." <rjf2@CDC.GOV>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: "Fehd, Ronald J." <rjf2@CDC.GOV>
Subject: Re: Array Question
Content-Type: text/plain; charset="windows-1252"
> From: MattFlynn [mailto:Matt.Flynn@THEHARTFORD.COM]
> Given an array or list of variables, is there a
> simple/elegant way to sort/rank the five values of the array,
> while identifying the relative position of each? For example:
>
> data one;
> input c1 c2 c3 c4;
> array c (5) c1-c5;
> cards;
> 11 52 44 21 37
> ;
RTFA: Read The Friendly Archives
if you search on the function <ordinal> you will find the answer the this.
array s (5);
do i = 1 to dim(s);
s = ordinal(i,c(i));
be aware of problems w/duplicates.
Archives will tell you correct wording for documentation.
Ron Fehd the macro maven CDC Atlanta GA USA RJF2@cdc.gov
|