<?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 NODUP in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/PROC-SORT-NODUP/m-p/528930#M73658</link>
    <description>&lt;P&gt;The NODUP option only eliminates duplicate rows that just by happenstance end up being ready for output adjacent to each other.&lt;/P&gt;
&lt;P&gt;Example:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;PersonID | Age | Wt
1 | 10 | 100
1 | 12 | 200
1 | 10 | 100&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;None of the records are deleted since each is different from the one next to it.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;When you sort by ALL of the variables you eliminate all of the duplicate records since duplicate records are guaranteed to end up next to each other, but if you only sort by PERSON_ID then duplicate records could still get output.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you just want one record per PERSON_ID then use the NODUPKEY option instead.&lt;/P&gt;</description>
    <pubDate>Mon, 21 Jan 2019 22:36:32 GMT</pubDate>
    <dc:creator>Tom</dc:creator>
    <dc:date>2019-01-21T22:36:32Z</dc:date>
    <item>
      <title>PROC SORT NODUP</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/PROC-SORT-NODUP/m-p/528921#M73657</link>
      <description>&lt;P&gt;&amp;nbsp;I am apparently having some trouble understanding NODUP. If I run the two following lines of code:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc sort data= have nodup out = ck1 ;by _all_; run;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;proc sort data= have nodup out = ck2 ;by person_id; run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I get different results: the first line deletes more duplicate records that the second one. As I understood nodup, it should delete records where all variables are the same, and sort by the by variables. So the sort order might be different, but the deleted records should be the same.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can someone help me understand what is happening? Thank you!&lt;/P&gt;</description>
      <pubDate>Mon, 21 Jan 2019 22:13:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/PROC-SORT-NODUP/m-p/528921#M73657</guid>
      <dc:creator>nmp</dc:creator>
      <dc:date>2019-01-21T22:13:58Z</dc:date>
    </item>
    <item>
      <title>Re: PROC SORT NODUP</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/PROC-SORT-NODUP/m-p/528930#M73658</link>
      <description>&lt;P&gt;The NODUP option only eliminates duplicate rows that just by happenstance end up being ready for output adjacent to each other.&lt;/P&gt;
&lt;P&gt;Example:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;PersonID | Age | Wt
1 | 10 | 100
1 | 12 | 200
1 | 10 | 100&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;None of the records are deleted since each is different from the one next to it.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;When you sort by ALL of the variables you eliminate all of the duplicate records since duplicate records are guaranteed to end up next to each other, but if you only sort by PERSON_ID then duplicate records could still get output.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you just want one record per PERSON_ID then use the NODUPKEY option instead.&lt;/P&gt;</description>
      <pubDate>Mon, 21 Jan 2019 22:36:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/PROC-SORT-NODUP/m-p/528930#M73658</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2019-01-21T22:36:32Z</dc:date>
    </item>
    <item>
      <title>Re: PROC SORT NODUP</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/PROC-SORT-NODUP/m-p/528931#M73659</link>
      <description>&lt;P&gt;Great, thank you for your prompt and clear reply, I did know the NODUPKEY, but clearly did not understand the process by which NODUP eliminates records. Now I do.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;</description>
      <pubDate>Mon, 21 Jan 2019 22:40:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/PROC-SORT-NODUP/m-p/528931#M73659</guid>
      <dc:creator>nmp</dc:creator>
      <dc:date>2019-01-21T22:40:34Z</dc:date>
    </item>
  </channel>
</rss>

