<?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 in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Proc-sort/m-p/808098#M318645</link>
    <description>"Proc sort will happily corrupt your source data"&lt;BR /&gt;&lt;BR /&gt;LOL.</description>
    <pubDate>Fri, 15 Apr 2022 22:20:58 GMT</pubDate>
    <dc:creator>HB</dc:creator>
    <dc:date>2022-04-15T22:20:58Z</dc:date>
    <item>
      <title>Proc sort</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-sort/m-p/807883#M318562</link>
      <description>Hello team,&lt;BR /&gt;I have duplicated rows and I need to remove them. I put. &lt;BR /&gt;Proc sort data=mydata nodupkey;&lt;BR /&gt;By _all_;&lt;BR /&gt;Run;&lt;BR /&gt;It doesn’t remove the observations&lt;BR /&gt;Regards&lt;BR /&gt;Blueblue</description>
      <pubDate>Thu, 14 Apr 2022 17:28:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-sort/m-p/807883#M318562</guid>
      <dc:creator>GN0001</dc:creator>
      <dc:date>2022-04-14T17:28:10Z</dc:date>
    </item>
    <item>
      <title>Re: Proc sort</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-sort/m-p/807886#M318563</link>
      <description>&lt;P&gt;I think you need out=&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/proc/n1ab4sjiq6wxkvn1npo1pq1cvhxt.htm" target="_self"&gt;https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/proc/n1ab4sjiq6wxkvn1npo1pq1cvhxt.htm&lt;/A&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 14 Apr 2022 17:42:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-sort/m-p/807886#M318563</guid>
      <dc:creator>HB</dc:creator>
      <dc:date>2022-04-14T17:42:44Z</dc:date>
    </item>
    <item>
      <title>Re: Proc sort</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-sort/m-p/807889#M318564</link>
      <description>&lt;P&gt;When you use BY _ALL_ there is a chance that values that look the same at first glance actually aren't. Formats for numeric values typically round. So a value of 1.999999999 and a format of BEST5. the displayed value will be 2.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Sometimes you have leading spaces in character values and depending on how you display them you can think they are the same but the leading space is significant when used as a By variable. Formats also come into play with character values as well. If the Format is $5. And you have values Blackstone and Blackheart they both, because of the format, display as Black. So you may want to check character variable length and format lengths.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Or the formats that may create groups.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 14 Apr 2022 18:12:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-sort/m-p/807889#M318564</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2022-04-14T18:12:48Z</dc:date>
    </item>
    <item>
      <title>Re: Proc sort</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-sort/m-p/807914#M318572</link>
      <description>&lt;P&gt;Post usable example data that illustrates your issue.&lt;/P&gt;</description>
      <pubDate>Thu, 14 Apr 2022 19:51:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-sort/m-p/807914#M318572</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2022-04-14T19:51:17Z</dc:date>
    </item>
    <item>
      <title>Re: Proc sort</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-sort/m-p/807926#M318576</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/6401"&gt;@HB&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;I think you need out=&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/proc/n1ab4sjiq6wxkvn1npo1pq1cvhxt.htm" target="_self"&gt;https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/proc/n1ab4sjiq6wxkvn1npo1pq1cvhxt.htm&lt;/A&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Not needed though a good idea. See this log:&lt;/P&gt;
&lt;PRE&gt;149  /* make a temporary data set to test the nodupkey with*/
150  data class;
151     set sashelp.class;
152  run;

NOTE: There were 19 observations read from the data set SASHELP.CLASS.
NOTE: The data set WORK.CLASS has 19 observations and 5 variables.
NOTE: DATA statement used (Total process time):
      real time           0.00 seconds
      cpu time            0.00 seconds


153
154  proc sort data=class nodupkey;
155     by sex age;
156  run;

NOTE: There were 19 observations read from the data set WORK.CLASS.
NOTE: 8 observations with duplicate key values were deleted.
NOTE: The data set WORK.CLASS has 11 observations and 5 variables.
&lt;/PRE&gt;
&lt;P&gt;I used the Sashelp.class data set so others can test the code, making a copy in the Work library in the data step.&lt;/P&gt;
&lt;P&gt;Then used Proc Sort with the Nodupkey option and no Out= option.&lt;/P&gt;
&lt;P&gt;Notice that the resulting work.class data set now has 11 observations, not the 19 from copying Sashelp.class.&lt;/P&gt;
&lt;P&gt;Proc sort will happily corrupt your source data set. So If you think that you may ever want to use the data from work.class from before the source then you &lt;STRONG&gt;should&lt;/STRONG&gt; use an Out=&amp;nbsp; option to create a new data set.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 14 Apr 2022 20:37:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-sort/m-p/807926#M318576</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2022-04-14T20:37:11Z</dc:date>
    </item>
    <item>
      <title>Re: Proc sort</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-sort/m-p/808098#M318645</link>
      <description>"Proc sort will happily corrupt your source data"&lt;BR /&gt;&lt;BR /&gt;LOL.</description>
      <pubDate>Fri, 15 Apr 2022 22:20:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-sort/m-p/808098#M318645</guid>
      <dc:creator>HB</dc:creator>
      <dc:date>2022-04-15T22:20:58Z</dc:date>
    </item>
  </channel>
</rss>

