BookmarkSubscribeRSS Feed
jaliu
Quartz | Level 8

It seems like they are not automatically sorted based on the variable of the following column.

1 REPLY 1
Tom
Super User Tom
Super User

In general if there are repeated observations for a given set of values of the BY variables the order of those observations is not set.  

In practice PROC SORT would historically return them in the same order they were found in the input dataset, mainly as a side effect of processing the data sequentially.  With the multi-threaded sorting in more recent implementations of SAS preserving this order requires extra work.  So SAS has added an option that will allow you say you don't care if the input order is preserved.

 

https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/proc/p02bhn81rn4u64n1b6l00ftdnxge.htm#n0cuj0z...

 

EQUALS | NOEQUALS

specifies the order of the observations in the output data set. For observations with identical BY-variable values, EQUALS maintains the relative order of the observations within the input data set in the output data set. NOEQUALS does not necessarily preserve this order in the output data set.

Default EQUALS
Interactions When you use NODUPKEY to remove observations in the output data set, the choice of EQUALS or NOEQUALS can affect which observations are removed.
The EQUALS | NOEQUALS procedure option overrides the default sort stability behavior that is established with the SORTEQUALS | NOSORTEQUALS system option.
The EQUALS option is supported by the threaded sort. However, I/O performance might be reduced when using the EQUALS option with the threaded sort because partitioned data sets are processed as if they consist of a single partition.
The NOEQUALS option is supported by the threaded sort. The order of observations within BY groups that are returned by the threaded sort might not be consistent between runs.
Tip Using NOEQUALS can save CPU time and memory.

 

sas-innovate-2024.png

 

Time is running out to save with the early bird rate. Register by Friday, March 1 for just $695 - $100 off the standard rate.

 

Check out the agenda and get ready for a jam-packed event featuring workshops, super demos, breakout sessions, roundtables, inspiring keynotes and incredible networking events. 

 

Register now!

5 Steps to Your First Analytics Project Using SAS

For SAS newbies, this video is a great way to get started. James Harroun walks through the process using SAS Studio for SAS OnDemand for Academics, but the same steps apply to any analytics project.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 1 reply
  • 364 views
  • 0 likes
  • 2 in conversation