| Date: | Thu, 7 May 2009 14:44:32 -0700 |
| Reply-To: | Francogrex <franco@GREX.ORG> |
| Sender: | "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU> |
| From: | Francogrex <franco@GREX.ORG> |
| Organization: | http://groups.google.com |
| Subject: | Array sorting |
|
| Content-Type: | text/plain; charset=ISO-8859-1 |
Why this below is giving an error and how to fix it. thanks.
data sortme;
array Arr(8) (47 14 51 12 75 4 5 5);
do j=2 to dim(Arr);
key = Arr(j);
i = j - 1;
do while((i > 0) & (Arr(i) > key));
Arr(i+1)=Arr(i);
i= i - 1;
end;
Arr(i+1)= key;
end;
run;
proc print data=sortme;
run;
|