<?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 in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/PROC-SORT/m-p/133713#M36295</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Folks,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;'when we are using options like noduprecs or nodupkey with Proc Sort does the dataset need to be sorted before&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For ex:&lt;/P&gt;&lt;P&gt;1 menthod&lt;/P&gt;&lt;P&gt;Proc sort data= stats;&lt;/P&gt;&lt;P&gt;by state region;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc sort data= stats (noduprecs/nodupkey);&lt;/P&gt;&lt;P&gt;by state region;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;or &lt;/P&gt;&lt;P&gt;2 methos&lt;/P&gt;&lt;P&gt;Proc sort data=stats (noduprecs/nodupkey);&lt;/P&gt;&lt;P&gt;by state region;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is there any problem with 2 method.I think it will remove duplicate observations.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 10 May 2013 20:54:20 GMT</pubDate>
    <dc:creator>JasonNC</dc:creator>
    <dc:date>2013-05-10T20:54:20Z</dc:date>
    <item>
      <title>PROC SORT</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/PROC-SORT/m-p/133713#M36295</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Folks,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;'when we are using options like noduprecs or nodupkey with Proc Sort does the dataset need to be sorted before&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For ex:&lt;/P&gt;&lt;P&gt;1 menthod&lt;/P&gt;&lt;P&gt;Proc sort data= stats;&lt;/P&gt;&lt;P&gt;by state region;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc sort data= stats (noduprecs/nodupkey);&lt;/P&gt;&lt;P&gt;by state region;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;or &lt;/P&gt;&lt;P&gt;2 methos&lt;/P&gt;&lt;P&gt;Proc sort data=stats (noduprecs/nodupkey);&lt;/P&gt;&lt;P&gt;by state region;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is there any problem with 2 method.I think it will remove duplicate observations.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 May 2013 20:54:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/PROC-SORT/m-p/133713#M36295</guid>
      <dc:creator>JasonNC</dc:creator>
      <dc:date>2013-05-10T20:54:20Z</dc:date>
    </item>
    <item>
      <title>Re: PROC SORT</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/PROC-SORT/m-p/133714#M36296</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;A __default_attr="678670" __jive_macro_name="user" class="jive_macro jive_macro_user" data-objecttype="3" href="https://communities.sas.com/"&gt;&lt;/A&gt;: First, I have NEVER seen a situation where NODUPRECs is of any value.&amp;nbsp; If you don't want duplicates, use NODUPKEY and specify the by variables that you want to ensure aren't duplicated.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Second, no, you don't have to presort your data unless you want to control which of the duplicate records gets deleted.&amp;nbsp; E.g., if the records included a date field and you only wanted to keep the most recent date, you might use two sorts like:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;proc sort data= stats;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&amp;nbsp; by state region descending date;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;proc sort data= stats nodupkey;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&amp;nbsp; by state region;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 May 2013 22:16:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/PROC-SORT/m-p/133714#M36296</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2013-05-10T22:16:25Z</dc:date>
    </item>
    <item>
      <title>Re: PROC SORT</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/PROC-SORT/m-p/133715#M36297</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Be aware of what noduprecs is doing versus nodupkey, there are separate options.&lt;/P&gt;&lt;P&gt;&lt;A href="http://www2.sas.com/proceedings/sugi30/037-30.pdf" title="http://www2.sas.com/proceedings/sugi30/037-30.pdf"&gt;http://www2.sas.com/proceedings/sugi30/037-30.pdf&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 May 2013 22:35:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/PROC-SORT/m-p/133715#M36297</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2013-05-10T22:35:32Z</dc:date>
    </item>
  </channel>
</rss>

