Why sorted data set gets processed faster in SAS during data manipulation?

sort
sas
data_wrangling

#1

Hi,

Whenever i perform any task like deletion, merging / joining / sub-setting, the performance of a sorted array is faster than than unsorted array, Has any one else experienced it?

If it is true, why does this happen? Does SAS perform any sorting / Indexing and if it is already done then it takes lesser time? Should we sort the data always and then perform other operations?

Please help me to understand it better.

Thx, Steve


#2

Steve,
In process like Merging using a Data command, sorting is compulsory. However, for any other operation the time taken should not differ as SAS does not do any kind of indexing (as far as I know) . However, if you are dealing with big data, sorting will take additional time before executing your main code.

Hope this helps
Tavish