<?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 Removing occurring in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Removing-occurring/m-p/705498#M216449</link>
    <description>&lt;P&gt;Hello Everyone,&lt;/P&gt;
&lt;P&gt;PFB input and desired o/p data where the repeated/duplicate alphabet gets removed. let's suppose there is huge data then how can we do? for few records it can be done via tranwrd but how for huge data. ?? Thanks in advance !&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;TABLE width="134"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD width="68.4444px"&gt;&amp;nbsp;&lt;/TD&gt;
&lt;TD width="73.7778px"&gt;&lt;STRONG&gt;input data&amp;nbsp;&lt;/STRONG&gt;&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="68.4444px"&gt;Field_Id&lt;/TD&gt;
&lt;TD width="73.7778px"&gt;Name&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="68.4444px"&gt;1&lt;/TD&gt;
&lt;TD width="73.7778px"&gt;Josse&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="68.4444px"&gt;2&lt;/TD&gt;
&lt;TD width="73.7778px"&gt;Aangeyy&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="68.4444px"&gt;3&lt;/TD&gt;
&lt;TD width="73.7778px"&gt;Suusa&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="68.4444px"&gt;4&lt;/TD&gt;
&lt;TD width="73.7778px"&gt;Henryy&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="68.4444px"&gt;5&lt;/TD&gt;
&lt;TD width="73.7778px"&gt;Johnn&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="68.4444px"&gt;6&lt;/TD&gt;
&lt;TD width="73.7778px"&gt;Joose&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;TABLE width="149"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD width="68.4444px" height="56px"&gt;&amp;nbsp;&lt;/TD&gt;
&lt;TD width="79.1111px" height="56px"&gt;&lt;STRONG&gt;Output data&amp;nbsp;&lt;/STRONG&gt;&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="68.4444px" height="29px"&gt;Field_Id&lt;/TD&gt;
&lt;TD width="79.1111px" height="29px"&gt;Name&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="68.4444px" height="29px"&gt;1&lt;/TD&gt;
&lt;TD width="79.1111px" height="29px"&gt;Jose&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="68.4444px" height="29px"&gt;2&lt;/TD&gt;
&lt;TD width="79.1111px" height="29px"&gt;Angey&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="68.4444px" height="29px"&gt;3&lt;/TD&gt;
&lt;TD width="79.1111px" height="29px"&gt;Susa&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="68.4444px" height="29px"&gt;4&lt;/TD&gt;
&lt;TD width="79.1111px" height="29px"&gt;Henry&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="68.4444px" height="29px"&gt;5&lt;/TD&gt;
&lt;TD width="79.1111px" height="29px"&gt;John&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="68.4444px" height="29px"&gt;6&lt;/TD&gt;
&lt;TD width="79.1111px" height="29px"&gt;Jose&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;</description>
    <pubDate>Sun, 13 Dec 2020 13:09:34 GMT</pubDate>
    <dc:creator>librasonali</dc:creator>
    <dc:date>2020-12-13T13:09:34Z</dc:date>
    <item>
      <title>Removing occurring</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Removing-occurring/m-p/705498#M216449</link>
      <description>&lt;P&gt;Hello Everyone,&lt;/P&gt;
&lt;P&gt;PFB input and desired o/p data where the repeated/duplicate alphabet gets removed. let's suppose there is huge data then how can we do? for few records it can be done via tranwrd but how for huge data. ?? Thanks in advance !&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;TABLE width="134"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD width="68.4444px"&gt;&amp;nbsp;&lt;/TD&gt;
&lt;TD width="73.7778px"&gt;&lt;STRONG&gt;input data&amp;nbsp;&lt;/STRONG&gt;&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="68.4444px"&gt;Field_Id&lt;/TD&gt;
&lt;TD width="73.7778px"&gt;Name&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="68.4444px"&gt;1&lt;/TD&gt;
&lt;TD width="73.7778px"&gt;Josse&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="68.4444px"&gt;2&lt;/TD&gt;
&lt;TD width="73.7778px"&gt;Aangeyy&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="68.4444px"&gt;3&lt;/TD&gt;
&lt;TD width="73.7778px"&gt;Suusa&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="68.4444px"&gt;4&lt;/TD&gt;
&lt;TD width="73.7778px"&gt;Henryy&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="68.4444px"&gt;5&lt;/TD&gt;
&lt;TD width="73.7778px"&gt;Johnn&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="68.4444px"&gt;6&lt;/TD&gt;
&lt;TD width="73.7778px"&gt;Joose&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;TABLE width="149"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD width="68.4444px" height="56px"&gt;&amp;nbsp;&lt;/TD&gt;
&lt;TD width="79.1111px" height="56px"&gt;&lt;STRONG&gt;Output data&amp;nbsp;&lt;/STRONG&gt;&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="68.4444px" height="29px"&gt;Field_Id&lt;/TD&gt;
&lt;TD width="79.1111px" height="29px"&gt;Name&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="68.4444px" height="29px"&gt;1&lt;/TD&gt;
&lt;TD width="79.1111px" height="29px"&gt;Jose&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="68.4444px" height="29px"&gt;2&lt;/TD&gt;
&lt;TD width="79.1111px" height="29px"&gt;Angey&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="68.4444px" height="29px"&gt;3&lt;/TD&gt;
&lt;TD width="79.1111px" height="29px"&gt;Susa&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="68.4444px" height="29px"&gt;4&lt;/TD&gt;
&lt;TD width="79.1111px" height="29px"&gt;Henry&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="68.4444px" height="29px"&gt;5&lt;/TD&gt;
&lt;TD width="79.1111px" height="29px"&gt;John&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="68.4444px" height="29px"&gt;6&lt;/TD&gt;
&lt;TD width="79.1111px" height="29px"&gt;Jose&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;</description>
      <pubDate>Sun, 13 Dec 2020 13:09:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Removing-occurring/m-p/705498#M216449</guid>
      <dc:creator>librasonali</dc:creator>
      <dc:date>2020-12-13T13:09:34Z</dc:date>
    </item>
    <item>
      <title>Re: Removing occurring</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Removing-occurring/m-p/705499#M216450</link>
      <description>&lt;P&gt;What to do when there are legitimate repeated letters in a name, such as the name Matthew?&lt;/P&gt;</description>
      <pubDate>Sun, 13 Dec 2020 14:06:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Removing-occurring/m-p/705499#M216450</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2020-12-13T14:06:41Z</dc:date>
    </item>
    <item>
      <title>Re: Removing occurring</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Removing-occurring/m-p/705519#M216463</link>
      <description>&lt;P&gt;The whole task looks like homework, because in a real-world-scenario names exist that have repeated chars, like Otto or Lynn.&lt;/P&gt;
&lt;P&gt;A regular expression in prxchange can solve the problem:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
	set have;
	Name = prxchange('s/(.)\1+/$1/', -1, Name);
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Maybe the expressions needs to be explained &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;(.) matches one char, the parentheses create a capture group.&lt;/P&gt;
&lt;P&gt;\1+ matches the the first capture group&lt;/P&gt;
&lt;P&gt;$1 return the first capture group - one of the duplicated chars&lt;/P&gt;
&lt;P&gt;-1 repeat changing until no more match is found&lt;/P&gt;</description>
      <pubDate>Sun, 13 Dec 2020 17:41:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Removing-occurring/m-p/705519#M216463</guid>
      <dc:creator>andreas_lds</dc:creator>
      <dc:date>2020-12-13T17:41:02Z</dc:date>
    </item>
    <item>
      <title>Re: Removing occurring</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Removing-occurring/m-p/705546#M216476</link>
      <description>&lt;P&gt;Read&amp;nbsp;&lt;A href="https://blogs.sas.com/content/sgf/2020/11/04/removing-repeated-characters-in-sas-strings/" target="_self"&gt;Removing repeated characters in SAS strings&lt;/A&gt; by&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/51532"&gt;@LeonidBatkhan&lt;/a&gt;&amp;nbsp;.&lt;/P&gt;</description>
      <pubDate>Sun, 13 Dec 2020 20:05:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Removing-occurring/m-p/705546#M216476</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2020-12-13T20:05:48Z</dc:date>
    </item>
    <item>
      <title>Re: Removing occurring</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Removing-occurring/m-p/705583#M216490</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/15475"&gt;@andreas_lds&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It doesn't give the correct output. Didn't you mean something like this?&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
	set have;
	*search string in lowcase character and then do pattern matching and finally convert it into propcase;
	Name = propcase(prxchange('s/(.)\1+/$1/', -1, lowcase(Name)));
run;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 14 Dec 2020 05:16:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Removing-occurring/m-p/705583#M216490</guid>
      <dc:creator>hhinohar</dc:creator>
      <dc:date>2020-12-14T05:16:44Z</dc:date>
    </item>
    <item>
      <title>Re: Removing occurring</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Removing-occurring/m-p/705585#M216491</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/335263"&gt;@hhinohar&lt;/a&gt;: Seems that i forgot to add the "i" option to prxchange:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
   set have;
   Name = prxchange('s/(.)\1+/$1/i', -1, Name);
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 14 Dec 2020 06:27:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Removing-occurring/m-p/705585#M216491</guid>
      <dc:creator>andreas_lds</dc:creator>
      <dc:date>2020-12-14T06:27:42Z</dc:date>
    </item>
  </channel>
</rss>

