Reputation: 31
I googled, but I didn't find information about what algorithm is behind the scenes in the proc sort
in SAS? In Python, for example, sort()
uses timsort .
Upvotes: 3
Views: 1472
Reputation: 9569
As Stu has observed, proc sort is closed source, so the best we can do is speculate. Having said that, rather than there being just one algorithm used in all situations, I suspect that the choice of sorting algorithm(s) depends on at least the following factors:
proc sort
statement - in particular, noequals
(which requests a slightly faster but unstable sort), tagsort
and threads
.sortsize
and memsize
system options.sortpgm
, sortcutp
and other associated system options.It is worth noting that SAS has been around through many generations of computer hardware, and the optimal choice of sorting algorithm is heavily dependent on the hardware. Even bubble sort can theoretically be optimal on old enough systems. I would very much expect SAS to account for this sort of thing.
Upvotes: 2