<?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 Re: proc sort data using noduprecs in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/proc-sort-data-using-noduprecs/m-p/670981#M23344</link>
    <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/319930"&gt;@veda8&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;do we have to always sort by _ALL_ to use noduprecs?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;You don't "have" to, SAS will happily let you use any subset of the variables in the BY statement.&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;But if you want the result to eliminate all duplicate records you do.&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;The reason is that the DUP check (or as it has been renamed the DUPRECS check) only compares adjacent records.&amp;nbsp; So if you only sort by a subset of the variables then it is possible for two records that are exactly the same to be output.&amp;nbsp; They just need at least one observation that is different on some non-key (by) variable in between them.&lt;/P&gt;</description>
    <pubDate>Tue, 21 Jul 2020 13:37:11 GMT</pubDate>
    <dc:creator>Tom</dc:creator>
    <dc:date>2020-07-21T13:37:11Z</dc:date>
    <item>
      <title>proc sort data using noduprecs</title>
      <link>https://communities.sas.com/t5/New-SAS-User/proc-sort-data-using-noduprecs/m-p/670668#M23321</link>
      <description>&lt;P&gt;do we have to always sort by _ALL_ to use noduprecs?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 20 Jul 2020 14:08:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/proc-sort-data-using-noduprecs/m-p/670668#M23321</guid>
      <dc:creator>veda8</dc:creator>
      <dc:date>2020-07-20T14:08:49Z</dc:date>
    </item>
    <item>
      <title>Re: proc sort data using noduprecs</title>
      <link>https://communities.sas.com/t5/New-SAS-User/proc-sort-data-using-noduprecs/m-p/670672#M23322</link>
      <description>&lt;P&gt;No:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
input ID var;
datalines;
1 10
1 20
1 10
3 50
3 50
3 50
2 30
2 30
2 40
;

proc sort data=have noduprec;
   by ID;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 20 Jul 2020 14:16:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/proc-sort-data-using-noduprecs/m-p/670672#M23322</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2020-07-20T14:16:33Z</dc:date>
    </item>
    <item>
      <title>Re: proc sort data using noduprecs and no dupkey</title>
      <link>https://communities.sas.com/t5/New-SAS-User/proc-sort-data-using-noduprecs/m-p/670678#M23323</link>
      <description>&lt;P&gt;when use nodupkey and give two variables in dupkey&amp;nbsp;&lt;/P&gt;&lt;P&gt;eg :&lt;/P&gt;&lt;P&gt;by id var;&lt;/P&gt;&lt;P&gt;which var(s) is considered as dupkey?&lt;/P&gt;</description>
      <pubDate>Mon, 20 Jul 2020 14:31:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/proc-sort-data-using-noduprecs/m-p/670678#M23323</guid>
      <dc:creator>veda8</dc:creator>
      <dc:date>2020-07-20T14:31:57Z</dc:date>
    </item>
    <item>
      <title>Re: proc sort data using noduprecs and no dupkey</title>
      <link>https://communities.sas.com/t5/New-SAS-User/proc-sort-data-using-noduprecs/m-p/670684#M23324</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/319930"&gt;@veda8&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;when use nodupkey and give two variables in dupkey&amp;nbsp;&lt;/P&gt;
&lt;P&gt;eg :&lt;/P&gt;
&lt;P&gt;by id var;&lt;/P&gt;
&lt;P&gt;which var(s) is considered as dupkey?&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Both.&lt;/P&gt;
&lt;P&gt;The "key" is whatever is on the By statement.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;DIV class="xis-refProc"&gt;
&lt;DIV class="xis-procStatement"&gt;
&lt;DIV class="xis-procStatementSyntax"&gt;
&lt;DIV class="xis-syntaxDescription"&gt;
&lt;DIV class="xis-otherArgGroup"&gt;
&lt;DIV id="n1vj0k9e0ir1o7n1vg3s4kcwiswg" class="xis-argDescriptionPair"&gt;
&lt;H4 class="xis-argument"&gt;NODUPKEY&lt;/H4&gt;
&lt;DIV class="xis-argumentDescription"&gt;
&lt;P class="xis-paraSimple"&gt;checks for and eliminates observations with duplicate BY values. If you specify this option, then PROC SORT compares all BY values for each observation to the ones for the previous observation that is written to the output data set. If an exact match is found, then the observation is not written to the output data set.&lt;/P&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/BLOCKQUOTE&gt;</description>
      <pubDate>Mon, 20 Jul 2020 14:48:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/proc-sort-data-using-noduprecs/m-p/670684#M23324</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2020-07-20T14:48:28Z</dc:date>
    </item>
    <item>
      <title>Re: proc sort data using noduprecs</title>
      <link>https://communities.sas.com/t5/New-SAS-User/proc-sort-data-using-noduprecs/m-p/670719#M23325</link>
      <description>You have to use a double sort with NODUPRECS as well. It isn't supported any longer and you shouldn't use it in production code going forward. Use NODUPKEY instead. SAS takes a while to deprecate features but it has been removed from the documentation and is currently maintained for backwards compatibility. &lt;BR /&gt;&lt;BR /&gt;&lt;A href="https://documentation.sas.com/?docsetId=proc&amp;amp;docsetVersion=9.4&amp;amp;docsetTarget=p02bhn81rn4u64n1b6l00ftdnxge.htm&amp;amp;locale=en" target="_blank"&gt;https://documentation.sas.com/?docsetId=proc&amp;amp;docsetVersion=9.4&amp;amp;docsetTarget=p02bhn81rn4u64n1b6l00ftdnxge.htm&amp;amp;locale=en&lt;/A&gt;</description>
      <pubDate>Mon, 20 Jul 2020 16:37:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/proc-sort-data-using-noduprecs/m-p/670719#M23325</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2020-07-20T16:37:40Z</dc:date>
    </item>
    <item>
      <title>Re: proc sort data using noduprecs</title>
      <link>https://communities.sas.com/t5/New-SAS-User/proc-sort-data-using-noduprecs/m-p/670960#M23343</link>
      <description>I think it is Yes. &lt;BR /&gt;And better NOT use noduprecs , try nodupkey + _all_   instead.</description>
      <pubDate>Tue, 21 Jul 2020 13:12:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/proc-sort-data-using-noduprecs/m-p/670960#M23343</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2020-07-21T13:12:34Z</dc:date>
    </item>
    <item>
      <title>Re: proc sort data using noduprecs</title>
      <link>https://communities.sas.com/t5/New-SAS-User/proc-sort-data-using-noduprecs/m-p/670981#M23344</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/319930"&gt;@veda8&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;do we have to always sort by _ALL_ to use noduprecs?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;You don't "have" to, SAS will happily let you use any subset of the variables in the BY statement.&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;But if you want the result to eliminate all duplicate records you do.&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;The reason is that the DUP check (or as it has been renamed the DUPRECS check) only compares adjacent records.&amp;nbsp; So if you only sort by a subset of the variables then it is possible for two records that are exactly the same to be output.&amp;nbsp; They just need at least one observation that is different on some non-key (by) variable in between them.&lt;/P&gt;</description>
      <pubDate>Tue, 21 Jul 2020 13:37:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/proc-sort-data-using-noduprecs/m-p/670981#M23344</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2020-07-21T13:37:11Z</dc:date>
    </item>
  </channel>
</rss>

