<?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: Identify duplicate if the string has same characters in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Identify-duplicate-if-the-string-has-same-characters/m-p/293621#M61157</link>
    <description>&lt;P&gt;Someone may have incorrectly written it but it would have all the caracters from the the previous one. Like 78956 to 65987 and so on.&lt;/P&gt;&lt;P&gt;it just may be reordered thats all&lt;/P&gt;</description>
    <pubDate>Wed, 24 Aug 2016 04:36:24 GMT</pubDate>
    <dc:creator>rahul88888</dc:creator>
    <dc:date>2016-08-24T04:36:24Z</dc:date>
    <item>
      <title>Identify duplicate if the string has same characters</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Identify-duplicate-if-the-string-has-same-characters/m-p/293612#M61154</link>
      <description>&lt;P&gt;I have a dataset that looks like this&lt;/P&gt;&lt;P&gt;data temp;&lt;BR /&gt;input Inv_Code $20.;&lt;BR /&gt;datalines;&lt;BR /&gt;INV001&lt;BR /&gt;INV002&lt;BR /&gt;964987&lt;BR /&gt;789469&lt;BR /&gt;I-87700&lt;BR /&gt;776012&lt;BR /&gt;FM073026-1&lt;BR /&gt;14774&lt;BR /&gt;16316/1&lt;BR /&gt;27107&lt;BR /&gt;56549&lt;BR /&gt;001INV&lt;BR /&gt;210677&lt;BR /&gt;70172&lt;BR /&gt;FM0668#8-1&lt;BR /&gt;11459/1&lt;BR /&gt;1/61361&lt;BR /&gt;;&lt;/P&gt;&lt;P&gt;run;&lt;BR /&gt;I need to identify duplicates as under :&lt;BR /&gt;INV001&lt;BR /&gt;001INV&lt;BR /&gt;789469&lt;BR /&gt;etc so on and so forth&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 24 Aug 2016 03:38:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Identify-duplicate-if-the-string-has-same-characters/m-p/293612#M61154</guid>
      <dc:creator>rahul88888</dc:creator>
      <dc:date>2016-08-24T03:38:32Z</dc:date>
    </item>
    <item>
      <title>Re: Identify duplicate if the string has same characters</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Identify-duplicate-if-the-string-has-same-characters/m-p/293617#M61156</link>
      <description>&lt;P&gt;Are you considering&amp;nbsp;&lt;SPAN&gt;INV001 and 001INV as similar string&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;964987 and&amp;nbsp;789469 as similar string.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;What is the basis to consider two string duplicate?&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 24 Aug 2016 04:12:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Identify-duplicate-if-the-string-has-same-characters/m-p/293617#M61156</guid>
      <dc:creator>RahulG</dc:creator>
      <dc:date>2016-08-24T04:12:49Z</dc:date>
    </item>
    <item>
      <title>Re: Identify duplicate if the string has same characters</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Identify-duplicate-if-the-string-has-same-characters/m-p/293621#M61157</link>
      <description>&lt;P&gt;Someone may have incorrectly written it but it would have all the caracters from the the previous one. Like 78956 to 65987 and so on.&lt;/P&gt;&lt;P&gt;it just may be reordered thats all&lt;/P&gt;</description>
      <pubDate>Wed, 24 Aug 2016 04:36:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Identify-duplicate-if-the-string-has-same-characters/m-p/293621#M61157</guid>
      <dc:creator>rahul88888</dc:creator>
      <dc:date>2016-08-24T04:36:24Z</dc:date>
    </item>
    <item>
      <title>Re: Identify duplicate if the string has same characters</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Identify-duplicate-if-the-string-has-same-characters/m-p/293632#M61161</link>
      <description>&lt;P&gt;One approach would assign each character to a separate variable:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data all_characters;&lt;/P&gt;
&lt;P&gt;set have;&lt;/P&gt;
&lt;P&gt;array letters {20} $ 1 C1-C20;&lt;/P&gt;
&lt;P&gt;do _n_=1 to 20;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp;letters{_n_} = substr(inv_code, _n_, 1);&lt;/P&gt;
&lt;P&gt;end;&lt;/P&gt;
&lt;P&gt;call sortc (of C1-C20);&lt;/P&gt;
&lt;P&gt;newkey = cat(of C1-C20);&lt;/P&gt;
&lt;P&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;By sorting the characters, it becomes relatively easy to compare for the same set of characters:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;proc sort data=all_characters;&lt;/P&gt;
&lt;P&gt;by newkey;&lt;/P&gt;
&lt;P&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data want;&lt;/P&gt;
&lt;P&gt;set all_characters;&lt;/P&gt;
&lt;P&gt;by newkey;&lt;/P&gt;
&lt;P&gt;if last.newkey=0 or first.newkey=0;&lt;/P&gt;
&lt;P&gt;run;&lt;/P&gt;</description>
      <pubDate>Wed, 24 Aug 2016 07:22:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Identify-duplicate-if-the-string-has-same-characters/m-p/293632#M61161</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2016-08-24T07:22:02Z</dc:date>
    </item>
    <item>
      <title>Re: Identify duplicate if the string has same characters</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Identify-duplicate-if-the-string-has-same-characters/m-p/293647#M61173</link>
      <description>&lt;P&gt;Thanks for the logic &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 24 Aug 2016 09:43:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Identify-duplicate-if-the-string-has-same-characters/m-p/293647#M61173</guid>
      <dc:creator>rahul88888</dc:creator>
      <dc:date>2016-08-24T09:43:00Z</dc:date>
    </item>
  </channel>
</rss>

