BookmarkSubscribeRSS Feed
0 Likes

The CALL SORTN Routine sorts array elements in the DATA-step.  
Suggestion:  Implement a faster CALL SORTN routine.

There are discussions in SAS Forums about this - 
 "the Quicksort Algorithm. The quicksort algorithm is popular, simple and very efficient.  Introduction here. The quicksort algorithm is cleverly implemented in the article Quicksorting An Array by Paul Dorfman. "

 

/Br AndersS (Anders Skollermo)

 

2 Comments
sbxkoenk
SAS Super FREQ

Hello,

 

Just for people bumping into this through an Internet Search.
I think this is an interesting tip :

SAS Tip: Sorting an Array in Descending Order
https://communities.sas.com/t5/SAS-Tips-from-the-Community/SAS-Tip-Sorting-an-Array-in-Descending-Or...

 

Koen

AndersS
Lapis Lazuli | Level 10

Hi! yes good point.  There are several suggested "better solutions on the Internet". But I want a better solution - in production. If possible. /Br AndersS