<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Proc sort nodupkey NoEQUALS/EQUALS in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Proc-sort-nodupkey-NoEQUALS-EQUALS/m-p/756137#M238684</link>
    <description>&lt;P&gt;Hello&lt;/P&gt;
&lt;P&gt;I want to learn the difference between equals and noequals in proc sort+nodupkey.&lt;/P&gt;
&lt;P&gt;I have some questions:&lt;/P&gt;
&lt;P&gt;1-Is it only relevant for using in Proc sort with nodupkey or also using proc sort without nodupkey?&lt;/P&gt;
&lt;P&gt;2- Why in the following 2 examples there are same results.&lt;/P&gt;
&lt;P&gt;As I understand using Equals SAS remain the same order of obserbations&amp;nbsp; as in source dataset (for each Sex)&amp;nbsp;&lt;/P&gt;
&lt;P&gt;and then will take the first observations (because of nodupkey option).&lt;/P&gt;
&lt;P&gt;What about&amp;nbsp;&amp;nbsp;&lt;STRONG&gt;noequals? What is the crtieria of sorting the data here?&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;proc sort data=sashelp.class out=emp1 nodupkey equals;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;by sex;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;run;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;proc sort data=sashelp.class out=emp2 nodupkey noequals;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;by sex;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;run;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;3- What is difference between:&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;proc sort data=sashelp.class out=emp1 nodupkey equals;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;by sex;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;run;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;and&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;proc sort data=sashelp.class out=ttt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;by sex;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;run;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Data wanted ;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;set ttt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;by sex;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;if first.sex;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Run;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 23 Jul 2021 07:24:02 GMT</pubDate>
    <dc:creator>Ronein</dc:creator>
    <dc:date>2021-07-23T07:24:02Z</dc:date>
    <item>
      <title>Proc sort nodupkey NoEQUALS/EQUALS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-sort-nodupkey-NoEQUALS-EQUALS/m-p/756137#M238684</link>
      <description>&lt;P&gt;Hello&lt;/P&gt;
&lt;P&gt;I want to learn the difference between equals and noequals in proc sort+nodupkey.&lt;/P&gt;
&lt;P&gt;I have some questions:&lt;/P&gt;
&lt;P&gt;1-Is it only relevant for using in Proc sort with nodupkey or also using proc sort without nodupkey?&lt;/P&gt;
&lt;P&gt;2- Why in the following 2 examples there are same results.&lt;/P&gt;
&lt;P&gt;As I understand using Equals SAS remain the same order of obserbations&amp;nbsp; as in source dataset (for each Sex)&amp;nbsp;&lt;/P&gt;
&lt;P&gt;and then will take the first observations (because of nodupkey option).&lt;/P&gt;
&lt;P&gt;What about&amp;nbsp;&amp;nbsp;&lt;STRONG&gt;noequals? What is the crtieria of sorting the data here?&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;proc sort data=sashelp.class out=emp1 nodupkey equals;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;by sex;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;run;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;proc sort data=sashelp.class out=emp2 nodupkey noequals;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;by sex;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;run;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;3- What is difference between:&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;proc sort data=sashelp.class out=emp1 nodupkey equals;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;by sex;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;run;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;and&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;proc sort data=sashelp.class out=ttt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;by sex;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;run;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Data wanted ;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;set ttt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;by sex;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;if first.sex;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Run;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 23 Jul 2021 07:24:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-sort-nodupkey-NoEQUALS-EQUALS/m-p/756137#M238684</guid>
      <dc:creator>Ronein</dc:creator>
      <dc:date>2021-07-23T07:24:02Z</dc:date>
    </item>
    <item>
      <title>Re: Proc sort nodupkey NoEQUALS/EQUALS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-sort-nodupkey-NoEQUALS-EQUALS/m-p/756140#M238685</link>
      <description>&lt;P&gt;Have you read the documentation of proc sort?&lt;/P&gt;
&lt;H4 class="xisDoc-argument"&gt;EQUALS | NOEQUALS&lt;/H4&gt;
&lt;DIV class="xisDoc-argumentDescription"&gt;
&lt;P class="xisDoc-paraSimpleFirst"&gt;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.&lt;/P&gt;
&lt;P class="xisDoc-paraSimpleFirst"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class="xisDoc-paraSimpleFirst"&gt;For more details see &lt;A href="https://documentation.sas.com/doc/de/pgmsascdc/9.4_3.5/proc/p02bhn81rn4u64n1b6l00ftdnxge.htm#p017kktdik5qqkn1rclxnqkjq7xn" target="_blank"&gt;https://documentation.sas.com/doc/de/pgmsascdc/9.4_3.5/proc/p02bhn81rn4u64n1b6l00ftdnxge.htm#p017kktdik5qqkn1rclxnqkjq7xn&lt;/A&gt;&lt;/P&gt;
&lt;/DIV&gt;</description>
      <pubDate>Fri, 23 Jul 2021 07:45:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-sort-nodupkey-NoEQUALS-EQUALS/m-p/756140#M238685</guid>
      <dc:creator>andreas_lds</dc:creator>
      <dc:date>2021-07-23T07:45:36Z</dc:date>
    </item>
    <item>
      <title>Re: Proc sort nodupkey NoEQUALS/EQUALS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-sort-nodupkey-NoEQUALS-EQUALS/m-p/756145#M238688</link>
      <description>Create a SAS data set with 10 observations and 3 variables.  Then test your questions.</description>
      <pubDate>Fri, 23 Jul 2021 08:56:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-sort-nodupkey-NoEQUALS-EQUALS/m-p/756145#M238688</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2021-07-23T08:56:16Z</dc:date>
    </item>
    <item>
      <title>Re: Proc sort nodupkey NoEQUALS/EQUALS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-sort-nodupkey-NoEQUALS-EQUALS/m-p/756251#M238728</link>
      <description>&lt;P&gt;One approach to comparing result data sets is to use PROC COMPARE with the two data sets.&lt;/P&gt;</description>
      <pubDate>Fri, 23 Jul 2021 16:00:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-sort-nodupkey-NoEQUALS-EQUALS/m-p/756251#M238728</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2021-07-23T16:00:42Z</dc:date>
    </item>
    <item>
      <title>Re: Proc sort nodupkey NoEQUALS/EQUALS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-sort-nodupkey-NoEQUALS-EQUALS/m-p/756363#M238764</link>
      <description>&lt;P&gt;If you are sorting a large data set in which there are many ties in the BY variables, using the EQUALS option to tell SAS to maintain the original relative order of records with tied BYs puts an extra burden on PROC SORT.&amp;nbsp; It can't just compare by values - it also has to have a (temporary) record number fo each observations.&amp;nbsp; So the proc sort with EQUALS can take a little extra time to run, due to this extra requirement.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;BTW, EQUALS is our default, and I believe the default for most SAS installations.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also, often using the NOEQUALS option will produce exactly the same sequence of records as EQUALS, even when there are lots of ties.&amp;nbsp; In fact, I don't recall ever seeing a difference when I inadvertently used NOEQUALS, and subsequently checked results against EQUALS.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And I almost always want the EQUALS option.&amp;nbsp; In particular, we have tens of millions of trades and quotes from public stocks exchanges per day.&amp;nbsp; They all have time stamps, but often a given stock will experience multiple records with the same time stamp (i.e. tied BY value).&amp;nbsp;&amp;nbsp;However, the physical order of the records provided by the data vendor represented the actual chronological order of the trades/quotes (time stamps have moved over the decades from whole seconds to nano-seconds).&amp;nbsp; To preserve that order (important to market microanalysis) we would always want EQUALS.&lt;/P&gt;</description>
      <pubDate>Sat, 24 Jul 2021 03:45:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-sort-nodupkey-NoEQUALS-EQUALS/m-p/756363#M238764</guid>
      <dc:creator>mkeintz</dc:creator>
      <dc:date>2021-07-24T03:45:34Z</dc:date>
    </item>
  </channel>
</rss>

