Kuber
Kuber

Reputation: 1041

Faster sort option in sas?

I have a large dataset of 1.2crore rows, which is taking around 30 min in sorting using usual SAS proc sort. Is there any faster algorithm/option in sas? Kuber

Upvotes: 0

Views: 6769

Answers (2)

Robert Penridge
Robert Penridge

Reputation: 8513

Without more details on how you are using the sorted dataset and what fields and lengths make up your dataset here's a few things you can try:

  • Use the tagsort option in proc sort. This is useful when the dataset is wide.
  • Create an index instead of sorting. If you are just going to do some by group processing then this will be faster and will work just as well.
  • If you are sorting in order to do a merge consider using either SQL joins (which may not need to sort as much data) or hashtables (which can be used to merge and don't require sorted data).
  • Compress the output dataset (if you aren't already) and/or the input dataset. This will reduce the IO.

But to answer your question, there is no faster sort procedure in sas then proc sort. According to the below PDF: The SAS® sort routine is of order O(NlogN), which is as fast as a comparison sort can be.

If you are working at a site that has syncsort licensed then this can speed it up, but this is usually enabled by default.

http://www2.sas.com/proceedings/sugi26/p121-26.pdf

Upvotes: 3

Jay Corbett
Jay Corbett

Reputation: 28391

If the reason you need to sort your data set is to merge it with another data set, you might look at doing your merge/lookup using a HASH object. Then you might not need to sort it.

Upvotes: 0

Related Questions