<?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: Is there any efficient solution to delete all duplicate values? in SAS Data Management</title>
    <link>https://communities.sas.com/t5/SAS-Data-Management/Is-there-any-efficient-solution-to-delete-all-duplicate-values/m-p/161861#M3062</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If your data is already sorted as in your example then you could also try:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;data want;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp; set have;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp; by col1 col2;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp; if first.col2 and last.col2;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;run;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Amir.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 16 May 2014 11:42:12 GMT</pubDate>
    <dc:creator>Amir</dc:creator>
    <dc:date>2014-05-16T11:42:12Z</dc:date>
    <item>
      <title>Is there any efficient solution to delete all duplicate values?</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Is-there-any-efficient-solution-to-delete-all-duplicate-values/m-p/161855#M3056</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;during my work i came to a question that bothers me a lot.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Assuming that i have a table with dupllicate values like:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Table:&lt;/P&gt;&lt;P&gt;Col1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Col2&lt;/P&gt;&lt;P&gt;123&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 456&lt;/P&gt;&lt;P&gt;123&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 456&lt;/P&gt;&lt;P&gt;456&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 789&lt;/P&gt;&lt;P&gt;456&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 888&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now i would like to &lt;STRONG&gt;delete all values&lt;/STRONG&gt; from Table that are &lt;STRONG&gt;completely identical&lt;/STRONG&gt; considering&lt;STRONG&gt; all columns&lt;/STRONG&gt;. (vIts very important that all columns are viewd of duplictes and not only col1)&lt;/P&gt;&lt;P&gt;How do i do this in an efficient way? I got an solution that consist of miles of code....its not efficient, simple and good in any way.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I mean if i use a proc sort with no duprecs, sas deletes only 1 to n duplicate values and not all.&lt;/P&gt;&lt;P&gt;Considering the table above wirh no duprecs or a control break (first. last. operator) there still will be one of those n duplicate values.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is there any efficient solution to my qustion or do i have to any poor solution by myself?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope someone can help.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks and regards&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;s&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 May 2014 09:25:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Is-there-any-efficient-solution-to-delete-all-duplicate-values/m-p/161855#M3056</guid>
      <dc:creator>asdf_sas</dc:creator>
      <dc:date>2014-05-16T09:25:57Z</dc:date>
    </item>
    <item>
      <title>Re: Is there any efficient solution to delete all duplicate values?</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Is-there-any-efficient-solution-to-delete-all-duplicate-values/m-p/161856#M3057</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sorry, what should be the output from that data you have given, should it be two records the 456 ones?&amp;nbsp; If so proc sort should handle that fine.&amp;nbsp; Or do you mean where a value appears in any column?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 May 2014 09:35:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Is-there-any-efficient-solution-to-delete-all-duplicate-values/m-p/161856#M3057</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2014-05-16T09:35:56Z</dc:date>
    </item>
    <item>
      <title>Re: Is there any efficient solution to delete all duplicate values?</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Is-there-any-efficient-solution-to-delete-all-duplicate-values/m-p/161857#M3058</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;proc sql;&lt;/P&gt;&lt;P&gt;create table want as select distinct * from have;&lt;/P&gt;&lt;P&gt;quit;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;or&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc sort&lt;/P&gt;&lt;P&gt;&amp;nbsp; data=want&lt;/P&gt;&lt;P&gt;&amp;nbsp; out=have&lt;/P&gt;&lt;P&gt;&amp;nbsp; nodupkey&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;by _all_;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 May 2014 09:47:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Is-there-any-efficient-solution-to-delete-all-duplicate-values/m-p/161857#M3058</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2014-05-16T09:47:55Z</dc:date>
    </item>
    <item>
      <title>Re: Is there any efficient solution to delete all duplicate values?</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Is-there-any-efficient-solution-to-delete-all-duplicate-values/m-p/161858#M3059</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The output should be both&amp;nbsp; 456 values, yes but none 123 values.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If i use a proc sort i get this result:&lt;/P&gt;&lt;P&gt;col1&amp;nbsp;&amp;nbsp;&amp;nbsp; col2&lt;/P&gt;&lt;P&gt;123&amp;nbsp;&amp;nbsp;&amp;nbsp; 456&lt;/P&gt;&lt;P&gt;456&amp;nbsp;&amp;nbsp;&amp;nbsp; 789&lt;/P&gt;&lt;P&gt;456&amp;nbsp;&amp;nbsp;&amp;nbsp; 888&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;but i want:&lt;/P&gt;&lt;P&gt;col1&amp;nbsp;&amp;nbsp;&amp;nbsp; col2&lt;/P&gt;&lt;P&gt;456&amp;nbsp;&amp;nbsp;&amp;nbsp; 789&lt;/P&gt;&lt;P&gt;456&amp;nbsp;&amp;nbsp;&amp;nbsp; 888&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;is there any other proc sort option i didnt thought about?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 May 2014 09:50:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Is-there-any-efficient-solution-to-delete-all-duplicate-values/m-p/161858#M3059</guid>
      <dc:creator>asdf_sas</dc:creator>
      <dc:date>2014-05-16T09:50:37Z</dc:date>
    </item>
    <item>
      <title>Re: Is there any efficient solution to delete all duplicate values?</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Is-there-any-efficient-solution-to-delete-all-duplicate-values/m-p/161859#M3060</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ok, this should do the job:&lt;/P&gt;&lt;P&gt;data have;&lt;BR /&gt;&amp;nbsp; attrib Col1 Col2 format=best.;&lt;BR /&gt;&amp;nbsp; infile datalines;&lt;BR /&gt;&amp;nbsp; input col1 col2;&lt;BR /&gt;datalines;&lt;BR /&gt;123&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 456&lt;BR /&gt;123&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 456&lt;BR /&gt;456&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 789&lt;BR /&gt;456&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 888&lt;BR /&gt;;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;proc sql;&lt;BR /&gt;&amp;nbsp; create table inter as&lt;BR /&gt;&amp;nbsp; select&amp;nbsp; col1,&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; col2,&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; tmp&lt;BR /&gt;&amp;nbsp; from&amp;nbsp;&amp;nbsp;&amp;nbsp; (select *,count(*) as tmp from have group by col1,col2)&lt;BR /&gt;&amp;nbsp; where&amp;nbsp;&amp;nbsp; tmp=1;&lt;BR /&gt;quit;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 May 2014 10:02:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Is-there-any-efficient-solution-to-delete-all-duplicate-values/m-p/161859#M3060</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2014-05-16T10:02:42Z</dc:date>
    </item>
    <item>
      <title>Re: Is there any efficient solution to delete all duplicate values?</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Is-there-any-efficient-solution-to-delete-all-duplicate-values/m-p/161860#M3061</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;yaaay thanks!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;this solution is far more short than the one i could've used!&lt;/P&gt;&lt;P&gt;nice, thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 May 2014 10:05:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Is-there-any-efficient-solution-to-delete-all-duplicate-values/m-p/161860#M3061</guid>
      <dc:creator>asdf_sas</dc:creator>
      <dc:date>2014-05-16T10:05:39Z</dc:date>
    </item>
    <item>
      <title>Re: Is there any efficient solution to delete all duplicate values?</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Is-there-any-efficient-solution-to-delete-all-duplicate-values/m-p/161861#M3062</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If your data is already sorted as in your example then you could also try:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;data want;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp; set have;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp; by col1 col2;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp; if first.col2 and last.col2;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;run;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Amir.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 May 2014 11:42:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Is-there-any-efficient-solution-to-delete-all-duplicate-values/m-p/161861#M3062</guid>
      <dc:creator>Amir</dc:creator>
      <dc:date>2014-05-16T11:42:12Z</dc:date>
    </item>
  </channel>
</rss>

