<?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: How to get duplicates from multiple columns in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-to-get-duplicates-from-multiple-columns/m-p/491043#M128669</link>
    <description>&lt;P&gt;You can sort inline so to speak.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you can have different cases (ie Ant vs ANT) they will not show up as duplicates.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Something like this, &lt;STRIKE&gt;untested code&lt;/STRIKE&gt;:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data temp;
set have;
call sortc(col1, col2, col3);
run;

proc sort data=temp out=want nouniquekey;
by col1 col2 col3;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/38234"&gt;@angeliquec&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Hi, I&amp;nbsp;would like to detect duplicate rows in my dataset below&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data HAVE;&lt;BR /&gt;infile datalines dlm="|";&lt;BR /&gt;input COL1 :$5. COL2 :$5. COL3 :$5.;&lt;BR /&gt;datalines;&lt;BR /&gt;CAT|DOG|ANT&lt;BR /&gt;ANT|CAT|DOG&lt;BR /&gt;HORSE|CAT|HORSE&lt;BR /&gt;;&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;*It's in Row 1 and 2.&lt;/P&gt;
&lt;P&gt;/*Output Duplicates*/&lt;BR /&gt;data WANT;&lt;BR /&gt;infile datalines dlm="|";&lt;BR /&gt;input COL1 :$5. COL2 :$5. COL3 :$5.;&lt;BR /&gt;datalines;&lt;BR /&gt;CAT|DOG|ANT&lt;BR /&gt;ANT|CAT|DOG&lt;BR /&gt;;&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'm not sure how to do it, I was thinking of transposing, sorting, then concatenation, but it seems not efficient. Perhaps there is a better way to do it. Thank you!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 30 Aug 2018 00:45:57 GMT</pubDate>
    <dc:creator>Reeza</dc:creator>
    <dc:date>2018-08-30T00:45:57Z</dc:date>
    <item>
      <title>How to get duplicates from multiple columns</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-get-duplicates-from-multiple-columns/m-p/491041#M128667</link>
      <description>&lt;P&gt;Hi, I&amp;nbsp;would like to detect duplicate rows in my dataset below&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data HAVE;&lt;BR /&gt;infile datalines dlm="|";&lt;BR /&gt;input COL1 :$5. COL2 :$5. COL3 :$5.;&lt;BR /&gt;datalines;&lt;BR /&gt;CAT|DOG|ANT&lt;BR /&gt;ANT|CAT|DOG&lt;BR /&gt;HORSE|CAT|HORSE&lt;BR /&gt;;&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;*It's in Row 1 and 2.&lt;/P&gt;
&lt;P&gt;/*Output Duplicates*/&lt;BR /&gt;data WANT;&lt;BR /&gt;infile datalines dlm="|";&lt;BR /&gt;input COL1 :$5. COL2 :$5. COL3 :$5.;&lt;BR /&gt;datalines;&lt;BR /&gt;CAT|DOG|ANT&lt;BR /&gt;ANT|CAT|DOG&lt;BR /&gt;;&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'm not sure how to do it, I was thinking of transposing, sorting, then concatenation, but it seems not efficient. Perhaps there is a better way to do it. Thank you!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 30 Aug 2018 00:33:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-get-duplicates-from-multiple-columns/m-p/491041#M128667</guid>
      <dc:creator>angeliquec</dc:creator>
      <dc:date>2018-08-30T00:33:28Z</dc:date>
    </item>
    <item>
      <title>Re: How to get duplicates from multiple columns</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-get-duplicates-from-multiple-columns/m-p/491043#M128669</link>
      <description>&lt;P&gt;You can sort inline so to speak.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you can have different cases (ie Ant vs ANT) they will not show up as duplicates.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Something like this, &lt;STRIKE&gt;untested code&lt;/STRIKE&gt;:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data temp;
set have;
call sortc(col1, col2, col3);
run;

proc sort data=temp out=want nouniquekey;
by col1 col2 col3;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/38234"&gt;@angeliquec&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Hi, I&amp;nbsp;would like to detect duplicate rows in my dataset below&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data HAVE;&lt;BR /&gt;infile datalines dlm="|";&lt;BR /&gt;input COL1 :$5. COL2 :$5. COL3 :$5.;&lt;BR /&gt;datalines;&lt;BR /&gt;CAT|DOG|ANT&lt;BR /&gt;ANT|CAT|DOG&lt;BR /&gt;HORSE|CAT|HORSE&lt;BR /&gt;;&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;*It's in Row 1 and 2.&lt;/P&gt;
&lt;P&gt;/*Output Duplicates*/&lt;BR /&gt;data WANT;&lt;BR /&gt;infile datalines dlm="|";&lt;BR /&gt;input COL1 :$5. COL2 :$5. COL3 :$5.;&lt;BR /&gt;datalines;&lt;BR /&gt;CAT|DOG|ANT&lt;BR /&gt;ANT|CAT|DOG&lt;BR /&gt;;&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'm not sure how to do it, I was thinking of transposing, sorting, then concatenation, but it seems not efficient. Perhaps there is a better way to do it. Thank you!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 30 Aug 2018 00:45:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-get-duplicates-from-multiple-columns/m-p/491043#M128669</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2018-08-30T00:45:57Z</dc:date>
    </item>
  </channel>
</rss>

