<?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: count the number of most occuring consecutive character in Email in SAS Enterprise Guide</title>
    <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/count-the-number-of-most-occuring-consecutive-character-in-Email/m-p/261205#M18203</link>
    <description>&lt;P&gt;Thank you.&amp;nbsp; I figured out the last question I had.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 04 Apr 2016 19:33:51 GMT</pubDate>
    <dc:creator>sdang</dc:creator>
    <dc:date>2016-04-04T19:33:51Z</dc:date>
    <item>
      <title>count the number of most occuring consecutive character in Email</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/count-the-number-of-most-occuring-consecutive-character-in-Email/m-p/260265#M18153</link>
      <description>&lt;P&gt;How can I find the most occuring occuring consecutive character in Email.&amp;nbsp; I have a table datasets with one Email field.&amp;nbsp; I want to create another columns next to the Email field showing (1)&amp;nbsp;which character occuring consecutive, and (2), count how many times it occur.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Wed, 30 Mar 2016 22:50:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/count-the-number-of-most-occuring-consecutive-character-in-Email/m-p/260265#M18153</guid>
      <dc:creator>sdang</dc:creator>
      <dc:date>2016-03-30T22:50:04Z</dc:date>
    </item>
    <item>
      <title>Re: count the number of most occuring consecutive character in Email</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/count-the-number-of-most-occuring-consecutive-character-in-Email/m-p/260283#M18161</link>
      <description>&lt;P&gt;Sample data, input and output.&lt;/P&gt;</description>
      <pubDate>Thu, 31 Mar 2016 01:40:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/count-the-number-of-most-occuring-consecutive-character-in-Email/m-p/260283#M18161</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-03-31T01:40:37Z</dc:date>
    </item>
    <item>
      <title>Re: count the number of most occuring consecutive character in Email</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/count-the-number-of-most-occuring-consecutive-character-in-Email/m-p/260547#M18176</link>
      <description>&lt;P&gt;Hi, for example:&amp;nbsp; Headers are fields name: Character Repeats and Count of Repeat are what I want to get based on the email provided.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Example Output based on variable Email.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;Email&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;| Character Repeats | Counts of Repeat&lt;/P&gt;
&lt;P&gt;happyggg@hotmail.com |&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ggg&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;|&amp;nbsp; 3&lt;/P&gt;
&lt;P&gt;HanDan2nnnng@gmail.com |&amp;nbsp; nnnn&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;|&amp;nbsp;&amp;nbsp; 4&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks, hope it helps.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 31 Mar 2016 20:33:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/count-the-number-of-most-occuring-consecutive-character-in-Email/m-p/260547#M18176</guid>
      <dc:creator>sdang</dc:creator>
      <dc:date>2016-03-31T20:33:59Z</dc:date>
    </item>
    <item>
      <title>Re: count the number of most occuring consecutive character in Email</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/count-the-number-of-most-occuring-consecutive-character-in-Email/m-p/260866#M18195</link>
      <description>&lt;P&gt;I suggest you check out the COUNTC function:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="http://support.sas.com/documentation/cdl/en/lefunctionsref/67960/HTML/default/viewer.htm#n1qcntq4r6p3w3n1mtsnm58tbomc.htm" target="_blank"&gt;http://support.sas.com/documentation/cdl/en/lefunctionsref/67960/HTML/default/viewer.htm#n1qcntq4r6p3w3n1mtsnm58tbomc.htm&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You could use this function for every alphabet character you wish to search for.&lt;/P&gt;</description>
      <pubDate>Sat, 02 Apr 2016 02:14:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/count-the-number-of-most-occuring-consecutive-character-in-Email/m-p/260866#M18195</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2016-04-02T02:14:19Z</dc:date>
    </item>
    <item>
      <title>Re: count the number of most occuring consecutive character in Email</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/count-the-number-of-most-occuring-consecutive-character-in-Email/m-p/260871#M18196</link>
      <description>&lt;P&gt;Brute force. I don't know if you could use perl expression for this, but that's an area I know very little about.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Key things to notice:&lt;/P&gt;
&lt;P&gt;CHAR() function retrieves the i'th letter from a string&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
email='happygggg@hotmail.com';output;
email='HanDan2nnnng@gmail.com'; output;
run;

data want;
set have;
length max_char $1.;
max_seq=0; max_char=' ';
do i=2 to length(email);
  if char(email, i-1)=char(email, i) then do;
	max_seq+1;
	max_char=char(email, i);
  end;

end;

max_seq_letter = repeat(max_char, max_seq);

drop i;

run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 02 Apr 2016 03:06:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/count-the-number-of-most-occuring-consecutive-character-in-Email/m-p/260871#M18196</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-04-02T03:06:43Z</dc:date>
    </item>
    <item>
      <title>Re: count the number of most occuring consecutive character in Email</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/count-the-number-of-most-occuring-consecutive-character-in-Email/m-p/261189#M18201</link>
      <description>&lt;P&gt;Thank you&lt;/P&gt;</description>
      <pubDate>Mon, 04 Apr 2016 18:41:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/count-the-number-of-most-occuring-consecutive-character-in-Email/m-p/261189#M18201</guid>
      <dc:creator>sdang</dc:creator>
      <dc:date>2016-04-04T18:41:21Z</dc:date>
    </item>
    <item>
      <title>Re: count the number of most occuring consecutive character in Email</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/count-the-number-of-most-occuring-consecutive-character-in-Email/m-p/261192#M18202</link>
      <description>&lt;P&gt;Thank you! This is what i needed.&amp;nbsp; But for the two example emails,&amp;nbsp;I want to&amp;nbsp;use emails&amp;nbsp;from another dataset, let's say Work.query_for_query_EMAIL and those codes below will run through all the rows and give me the results I needed.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 04 Apr 2016 18:44:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/count-the-number-of-most-occuring-consecutive-character-in-Email/m-p/261192#M18202</guid>
      <dc:creator>sdang</dc:creator>
      <dc:date>2016-04-04T18:44:20Z</dc:date>
    </item>
    <item>
      <title>Re: count the number of most occuring consecutive character in Email</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/count-the-number-of-most-occuring-consecutive-character-in-Email/m-p/261205#M18203</link>
      <description>&lt;P&gt;Thank you.&amp;nbsp; I figured out the last question I had.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 04 Apr 2016 19:33:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/count-the-number-of-most-occuring-consecutive-character-in-Email/m-p/261205#M18203</guid>
      <dc:creator>sdang</dc:creator>
      <dc:date>2016-04-04T19:33:51Z</dc:date>
    </item>
    <item>
      <title>Re: count the number of most occuring consecutive character in Email</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/count-the-number-of-most-occuring-consecutive-character-in-Email/m-p/272326#M18915</link>
      <description>&lt;P&gt;If more than one sequence of repeated characters can occur in the same string (as in ha&lt;STRONG&gt;pp&lt;/STRONG&gt;y&lt;STRONG&gt;gggg&lt;/STRONG&gt;), it is useful to work with two separate counters (LEN vs. MAX_SEQ in the code below, using Reeza's variable names):&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
set have;
length max_seq_letter $20
       max_char $1;
do i=2 to length(email);
  len=1;
  do while(char(email, i)=char(email, i-1));
    len+1;
    i+1;
  end;
  if len&amp;gt;max(max_seq, 1) then do;
    max_seq=len;
    max_char=char(email, i-1);
  end;
end;
if max_seq then max_seq_letter=repeat(max_char, max_seq-1);
output;
label max_seq='Counts of Repeat'
      max_seq_letter='Character Repeats';
drop i len max_char;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sun, 22 May 2016 20:25:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/count-the-number-of-most-occuring-consecutive-character-in-Email/m-p/272326#M18915</guid>
      <dc:creator>FreelanceReinh</dc:creator>
      <dc:date>2016-05-22T20:25:16Z</dc:date>
    </item>
  </channel>
</rss>

