<?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 identify repeating characters in the string. in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/How-to-identify-repeating-characters-in-the-string/m-p/211150#M52182</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hey. I was getting the correct result but I'm getting a warning too. So I modified a bit and tried but can't figure it out.&lt;/P&gt;&lt;P&gt;Would it be possible for you to tell me why I am getting the below warning and how can I fix it.&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data have;&lt;/P&gt;&lt;P&gt;var="Sasexampleee";output;&lt;/P&gt;&lt;P&gt;var="Sasexampplee";output;&lt;/P&gt;&lt;P&gt;var="Sasexammmppl";output;&lt;/P&gt;&lt;P&gt;var="Sasexampl";output;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data want;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; set have;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; leng=length(var);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; do i=1 to leng;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if substr(var, i, 1) = substr(var, i+1, 1) = substr(var, i+2, 1) then flag=1;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; end;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;NOTE: Invalid second argument to function SUBSTR at line 27 column 52.&lt;/P&gt;&lt;P&gt;NOTE: Invalid second argument to function SUBSTR at line 27 column 30.&lt;/P&gt;&lt;P&gt;NOTE: Invalid second argument to function SUBSTR at line 27 column 52.&lt;/P&gt;&lt;P&gt;var=Sasexampplee leng=12 i=13 flag=. _ERROR_=1 _N_=2&lt;/P&gt;&lt;P&gt;NOTE: Invalid second argument to function SUBSTR at line 27 column 52.&lt;/P&gt;&lt;P&gt;var=Sasexamplee leng=11 i=12 flag=. _ERROR_=1 _N_=4&lt;/P&gt;&lt;P&gt;NOTE: There were 4 observations read from the data set WORK.HAVE.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 29 Mar 2015 01:45:49 GMT</pubDate>
    <dc:creator>BOBSAS</dc:creator>
    <dc:date>2015-03-29T01:45:49Z</dc:date>
    <item>
      <title>How to identify repeating characters in the string.</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-identify-repeating-characters-in-the-string/m-p/211137#M52169</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="font-family: arial,helvetica,sans-serif; font-size: 11pt;"&gt;Hello, I have a 9 character data field and I need to identify if any 3 of the consecutive characters in that string are the same.&amp;nbsp; Any ideas on how to achieve this? &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: arial,helvetica,sans-serif; font-size: 11pt;"&gt;Thanks. &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: arial,helvetica,sans-serif; font-size: 11pt;"&gt;Pramodini&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 Mar 2015 14:30:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-identify-repeating-characters-in-the-string/m-p/211137#M52169</guid>
      <dc:creator>pr1</dc:creator>
      <dc:date>2015-03-26T14:30:21Z</dc:date>
    </item>
    <item>
      <title>Re: How to identify repeating characters in the string.</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-identify-repeating-characters-in-the-string/m-p/211138#M52170</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;could you please give an example data&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 Mar 2015 14:36:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-identify-repeating-characters-in-the-string/m-p/211138#M52170</guid>
      <dc:creator>Jagadishkatam</dc:creator>
      <dc:date>2015-03-26T14:36:01Z</dc:date>
    </item>
    <item>
      <title>Re: How to identify repeating characters in the string.</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-identify-repeating-characters-in-the-string/m-p/211139#M52171</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Does case matter? For example does "aAa" count as the "same character"? Are any of the characters special characters such as punctuation, ()!@#$%^&amp;amp;*-_=+/&amp;gt;&amp;lt;\|][{}&lt;/P&gt;&lt;P&gt;Do multiple spaces count?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 Mar 2015 14:42:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-identify-repeating-characters-in-the-string/m-p/211139#M52171</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2015-03-26T14:42:32Z</dc:date>
    </item>
    <item>
      <title>Re: How to identify repeating characters in the string.</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-identify-repeating-characters-in-the-string/m-p/211140#M52172</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Assuming&amp;nbsp; you want an exact match on any possible character, here is a way:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data want;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; set have;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; do i=1 to 7 until (flag=1);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if substr(var, i, 1) = substr(var, i+1, 1) = substr(var, i+2, 1) then flag=1;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; end;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Good luck.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 Mar 2015 14:46:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-identify-repeating-characters-in-the-string/m-p/211140#M52172</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2015-03-26T14:46:05Z</dc:date>
    </item>
    <item>
      <title>Re: How to identify repeating characters in the string.</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-identify-repeating-characters-in-the-string/m-p/211141#M52173</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Also you may try,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data have;&lt;/P&gt;&lt;P&gt;&amp;nbsp; char='a b b a c c c';&lt;/P&gt;&lt;P&gt;do&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; i = 1 to 10;&lt;/P&gt;&lt;P&gt;new2=scan(char,i,' ');&lt;/P&gt;&lt;P&gt;output;&lt;/P&gt;&lt;P&gt;end;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data want;&lt;/P&gt;&lt;P&gt;set have;&lt;/P&gt;&lt;P&gt;by notsorted new2;&lt;/P&gt;&lt;P&gt;retain count 0;&lt;/P&gt;&lt;P&gt;if first.new2 then count=1;&lt;/P&gt;&lt;P&gt;else count+1;&lt;/P&gt;&lt;P&gt;if last.new2 and count=3 and new2 ne '';&lt;/P&gt;&lt;P&gt;run; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;BR /&gt;Jag&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 Mar 2015 14:50:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-identify-repeating-characters-in-the-string/m-p/211141#M52173</guid>
      <dc:creator>Jagadishkatam</dc:creator>
      <dc:date>2015-03-26T14:50:00Z</dc:date>
    </item>
    <item>
      <title>Re: How to identify repeating characters in the string.</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-identify-repeating-characters-in-the-string/m-p/211142#M52174</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;THANK YOU all!!!&amp;nbsp; This works.&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;Appreciate all the help.&amp;nbsp; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 Mar 2015 15:16:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-identify-repeating-characters-in-the-string/m-p/211142#M52174</guid>
      <dc:creator>pr1</dc:creator>
      <dc:date>2015-03-26T15:16:22Z</dc:date>
    </item>
    <item>
      <title>Re: How to identify repeating characters in the string.</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-identify-repeating-characters-in-the-string/m-p/211143#M52175</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Come on, there has to be PRX solution for this &lt;img id="smileyhappy" class="emoticon emoticon-smileyhappy" src="https://communities.sas.com/i/smilies/16x16_smiley-happy.png" alt="Smiley Happy" title="Smiley Happy" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;STRONG style="color: navy; background: white; font-family: 'Courier New';"&gt;data&lt;/STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt; test;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue; background: white;"&gt;infile&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; color: blue; background: white;"&gt;cards&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; color: blue; background: white;"&gt;truncover&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue; background: white;"&gt;input&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt; str $ &lt;/SPAN&gt;&lt;STRONG style="color: teal; background: white; font-family: 'Courier New';"&gt;100.&lt;/STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;flag=prxmatch(&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: purple; background: white;"&gt;'m/(\S)\1{2}/o'&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;,str)&amp;gt;&lt;/SPAN&gt;&lt;STRONG style="color: teal; background: white; font-family: 'Courier New';"&gt;0&lt;/STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue; background: white;"&gt;cards&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: #FFFFC0;"&gt;adlsfkj888adklfj&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: #FFFFC0;"&gt;alkjahfkldjhklajdhfklj&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: #FFFFC0;"&gt;akljsd******alkdfkj&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 Mar 2015 15:18:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-identify-repeating-characters-in-the-string/m-p/211143#M52175</guid>
      <dc:creator>Haikuo</dc:creator>
      <dc:date>2015-03-26T15:18:43Z</dc:date>
    </item>
    <item>
      <title>Re: How to identify repeating characters in the string.</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-identify-repeating-characters-in-the-string/m-p/211144#M52176</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Here is an explaination of the regular expression:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;(\S)\1{2}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Match the regular expression below and capture its match into backreference number 1 «(\S)»&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; Match a single character that is a “non-whitespace character” «\S»&lt;/P&gt;&lt;P&gt;Match the same text as most recently matched by capturing group number 1 «\1{2}»&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; Exactly 2 times «{2}»&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The m before the starting delimiter (/) I would say is not relevant here.&lt;/P&gt;&lt;P&gt;The o after the ending delimiter (/) is an optimizer that tells SAS the expression can be held and reused without recompilation throughout the execution of the data step.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;See the documentation:&lt;/P&gt;&lt;P&gt;&lt;A href="http://support.sas.com/documentation/cdl/en/lrdict/64316/HTML/default/viewer.htm#a002295977.htm" title="http://support.sas.com/documentation/cdl/en/lrdict/64316/HTML/default/viewer.htm#a002295977.htm"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/A&gt;&lt;A href="http://support.sas.com/documentation/cdl/en/lrdict/64316/HTML/default/viewer.htm#a002295977.htm" target="_blank"&gt;http://support.sas.com/documentation/cdl/en/lrdict/64316/HTML/default/viewer.htm#a002295977.htm&lt;/A&gt;&lt;/P&gt;&lt;H3 style="font-family: arial, 'Arial Unicode MS', geneva, 'Lucida Grande', sans-serif; color: #000000; font-size: 16.1279983520508px; padding-top: 0.7em; background-color: #ffffff;"&gt;&lt;A name="a002603764" style="margin: 1em 0 0; font-size: 16.1279983520508px; font-family: inherit;"&gt;Compiling a Perl Regular Expression&lt;/A&gt;&lt;/H3&gt;&lt;PRE __jive_macro_name="quote" class="jive_text_macro jive_macro_quote"&gt;
&lt;P style="margin: 1.4em 0 0; font-size: 13.4399995803833px; font-family: arial, 'Arial Unicode MS', geneva, 'Lucida Grande', sans-serif; color: #000000; background-color: #ffffff;"&gt;&lt;A name="a002895349" style="font-family: inherit;"&gt;&lt;/A&gt;If &lt;SPAN class="emph" style="font-style: italic;"&gt;perl-regular-expression&lt;/SPAN&gt; is a constant or if it uses the /o option, the Perl regular expression is compiled only once. Successive calls to PRXPARSE will not cause a recompile, but will return the &lt;SPAN class="emph" style="font-style: italic;"&gt;regular-expression-id&lt;/SPAN&gt; for the regular expression that was already compiled. This behavior simplifies the code because you do not need to use an initialization block (IF _N_ =1) to initialize Perl regular expressions.&lt;/P&gt;
&lt;P style="margin: 1.4em 0 0; font-size: 13.4399995803833px; font-family: arial, 'Arial Unicode MS', geneva, 'Lucida Grande', sans-serif; color: #000000; background-color: #ffffff;"&gt;&lt;SPAN class="strong" style="font-weight: bold;"&gt;Note:&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp; If you have a Perl regular expression that is a constant, or if the regular expression uses the /o option, then calling PRXFREE to free the memory allocation results in the need to recompile the regular expression the next time that it is called by PRXPARSE.&lt;A name="a002895350" style="font-family: inherit;"&gt;&lt;/A&gt;&lt;/P&gt;
&lt;P style="margin: 1.4em 0 0; font-size: 13.4399995803833px; font-family: arial, 'Arial Unicode MS', geneva, 'Lucida Grande', sans-serif; color: #000000; background-color: #ffffff;"&gt;The compile-once behavior occurs when you use PRXPARSE in a DATA step. For all other uses, the &lt;SPAN class="emph" style="font-style: italic;"&gt;perl-regular-expression&lt;/SPAN&gt; is recompiled for each call to PRXPARSE.&amp;nbsp;&amp;nbsp; &lt;IMG align="bottom" alt="[cautionend]" border="0" class="jiveImage" src="http://support.sas.com/documentation/cdl/en/common/63294/HTML/default/images/cautend.gif" style="font-family: inherit;" /&gt;&lt;/P&gt;
&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 27 Mar 2015 00:04:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-identify-repeating-characters-in-the-string/m-p/211144#M52176</guid>
      <dc:creator>FriedEgg</dc:creator>
      <dc:date>2015-03-27T00:04:00Z</dc:date>
    </item>
    <item>
      <title>Re: How to identify repeating characters in the string.</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-identify-repeating-characters-in-the-string/m-p/211145#M52177</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi &lt;A __default_attr="733023" __jive_macro_name="user" class="jive_macro jive_macro_user" href="https://communities.sas.com/"&gt;&lt;/A&gt; A small request and sorry it's off topic, I have noticed you using &lt;STRONG&gt;APPC&lt;/STRONG&gt; functions extremely well as opposed many other major contributors. Can you please provide me a link documentation that explains pretty much well in detail for that one too? I'd appreciate it so much. Thanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 27 Mar 2015 16:45:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-identify-repeating-characters-in-the-string/m-p/211145#M52177</guid>
      <dc:creator>naveen_srini</dc:creator>
      <dc:date>2015-03-27T16:45:45Z</dc:date>
    </item>
    <item>
      <title>Re: How to identify repeating characters in the string.</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-identify-repeating-characters-in-the-string/m-p/211146#M52178</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Does anyone know if the "compile-once" behavior also occurs in SQL expressions?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Pg &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 27 Mar 2015 17:39:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-identify-repeating-characters-in-the-string/m-p/211146#M52178</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2015-03-27T17:39:37Z</dc:date>
    </item>
    <item>
      <title>Re: How to identify repeating characters in the string.</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-identify-repeating-characters-in-the-string/m-p/211147#M52179</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;PG, it does have a similar behavior in SQL&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 27 Mar 2015 19:51:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-identify-repeating-characters-in-the-string/m-p/211147#M52179</guid>
      <dc:creator>FriedEgg</dc:creator>
      <dc:date>2015-03-27T19:51:47Z</dc:date>
    </item>
    <item>
      <title>Re: How to identify repeating characters in the string.</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-identify-repeating-characters-in-the-string/m-p/211148#M52180</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;naveen_srini,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rather than taking this post off-topic, it would be more prudent to post a new question.&amp;nbsp; I will gladly answer you to the best that I can, as will others, I'm sure.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 27 Mar 2015 19:53:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-identify-repeating-characters-in-the-string/m-p/211148#M52180</guid>
      <dc:creator>FriedEgg</dc:creator>
      <dc:date>2015-03-27T19:53:25Z</dc:date>
    </item>
    <item>
      <title>Re: How to identify repeating characters in the string.</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-identify-repeating-characters-in-the-string/m-p/211149#M52181</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you Matt!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 28 Mar 2015 16:53:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-identify-repeating-characters-in-the-string/m-p/211149#M52181</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2015-03-28T16:53:20Z</dc:date>
    </item>
    <item>
      <title>Re: How to identify repeating characters in the string.</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-identify-repeating-characters-in-the-string/m-p/211150#M52182</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hey. I was getting the correct result but I'm getting a warning too. So I modified a bit and tried but can't figure it out.&lt;/P&gt;&lt;P&gt;Would it be possible for you to tell me why I am getting the below warning and how can I fix it.&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data have;&lt;/P&gt;&lt;P&gt;var="Sasexampleee";output;&lt;/P&gt;&lt;P&gt;var="Sasexampplee";output;&lt;/P&gt;&lt;P&gt;var="Sasexammmppl";output;&lt;/P&gt;&lt;P&gt;var="Sasexampl";output;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data want;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; set have;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; leng=length(var);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; do i=1 to leng;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if substr(var, i, 1) = substr(var, i+1, 1) = substr(var, i+2, 1) then flag=1;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; end;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;NOTE: Invalid second argument to function SUBSTR at line 27 column 52.&lt;/P&gt;&lt;P&gt;NOTE: Invalid second argument to function SUBSTR at line 27 column 30.&lt;/P&gt;&lt;P&gt;NOTE: Invalid second argument to function SUBSTR at line 27 column 52.&lt;/P&gt;&lt;P&gt;var=Sasexampplee leng=12 i=13 flag=. _ERROR_=1 _N_=2&lt;/P&gt;&lt;P&gt;NOTE: Invalid second argument to function SUBSTR at line 27 column 52.&lt;/P&gt;&lt;P&gt;var=Sasexamplee leng=11 i=12 flag=. _ERROR_=1 _N_=4&lt;/P&gt;&lt;P&gt;NOTE: There were 4 observations read from the data set WORK.HAVE.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 29 Mar 2015 01:45:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-identify-repeating-characters-in-the-string/m-p/211150#M52182</guid>
      <dc:creator>BOBSAS</dc:creator>
      <dc:date>2015-03-29T01:45:49Z</dc:date>
    </item>
    <item>
      <title>Re: How to identify repeating characters in the string.</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-identify-repeating-characters-in-the-string/m-p/211151#M52183</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;When &lt;EM&gt;i = leng&lt;/EM&gt; in your loop, you look at character position &lt;EM&gt;i+2&lt;/EM&gt; which is beyond the length of the variable. You can simply stop the loop sooner:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;data want;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp; set have;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp; leng=length(var) &lt;SPAN style="color: #800000;"&gt;- 2&lt;/SPAN&gt;;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp; do i=1 to leng;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if substr(var, i, 1) = substr(var, i+1, 1) = substr(var, i+2, 1) then flag=1;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp; end;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;run;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PG&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 29 Mar 2015 02:02:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-identify-repeating-characters-in-the-string/m-p/211151#M52183</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2015-03-29T02:02:47Z</dc:date>
    </item>
    <item>
      <title>Re: How to identify repeating characters in the string.</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-identify-repeating-characters-in-the-string/m-p/211152#M52184</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Worked well. Thanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 29 Mar 2015 02:10:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-identify-repeating-characters-in-the-string/m-p/211152#M52184</guid>
      <dc:creator>BOBSAS</dc:creator>
      <dc:date>2015-03-29T02:10:21Z</dc:date>
    </item>
    <item>
      <title>Re: How to identify repeating characters in the string.</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-identify-repeating-characters-in-the-string/m-p/211153#M52185</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This code is giving me false positive.&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have character data that has ID Numbers.&amp;nbsp; It is 9 character long string and has numbers as char data from 0 to 9.&amp;nbsp; I am trying to identify if 5 or more consecutive characters are the same.&amp;nbsp; If yes, then I will create a flag.&amp;nbsp; &lt;/P&gt;&lt;P&gt;I have this code below.&amp;nbsp; It works most of the time but also gives me false positive.&amp;nbsp; For example, it will pick up something like 121341111 – where the ‘1’ is within the string 5 or more times. &lt;/P&gt;&lt;P&gt;I want to identify only if a character is present consecutively 5 or more times.&amp;nbsp; 121341111 should not be flagged 1 repeated consecutively only 4 times.&amp;nbsp; &lt;/P&gt;&lt;P&gt;Any idea?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: navy; font-size: 10pt; background: white; font-family: 'Courier New';"&gt;data&lt;/STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 10pt;"&gt; want(&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: blue; font-size: 10pt;"&gt;drop&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 10pt;"&gt; = i) ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;SPAN style="font-family: 'Courier New'; background: white; color: blue; font-size: 10pt;"&gt;set&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 10pt;"&gt; have ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;SPAN style="font-family: 'Courier New'; background: white; color: blue; font-size: 10pt;"&gt;length&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 10pt;"&gt; ssn_char ssn_rept_chars $&lt;/SPAN&gt;&lt;STRONG style="color: teal; font-size: 10pt; background: white; font-family: 'Courier New';"&gt;9&lt;/STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 10pt;"&gt;; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 10pt;"&gt;&amp;nbsp; ssn_char = ssn;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;SPAN style="font-family: 'Courier New'; background: white; color: blue; font-size: 10pt;"&gt;do&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 10pt;"&gt; i=&lt;/SPAN&gt;&lt;STRONG style="color: teal; font-size: 10pt; background: white; font-family: 'Courier New';"&gt;1&lt;/STRONG&gt; &lt;SPAN style="font-family: 'Courier New'; background: white; color: blue; font-size: 10pt;"&gt;to&lt;/SPAN&gt; &lt;STRONG style="color: teal; font-size: 10pt; background: white; font-family: 'Courier New';"&gt;6&lt;/STRONG&gt; &lt;SPAN style="font-family: 'Courier New'; background: white; color: blue; font-size: 10pt;"&gt;until&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 10pt;"&gt; (flag=&lt;/SPAN&gt;&lt;STRONG style="color: teal; font-size: 10pt; background: white; font-family: 'Courier New';"&gt;1&lt;/STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 10pt;"&gt;);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;SPAN style="font-family: 'Courier New'; background: white; color: blue; font-size: 10pt;"&gt;if&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 10pt;"&gt; substr(ssn_char, i, &lt;/SPAN&gt;&lt;STRONG style="color: teal; font-size: 10pt; background: white; font-family: 'Courier New';"&gt;1&lt;/STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 10pt;"&gt;) = substr(ssn_char, i+&lt;/SPAN&gt;&lt;STRONG style="color: teal; font-size: 10pt; background: white; font-family: 'Courier New';"&gt;1&lt;/STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 10pt;"&gt;, &lt;/SPAN&gt;&lt;STRONG style="color: teal; font-size: 10pt; background: white; font-family: 'Courier New';"&gt;1&lt;/STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 10pt;"&gt;) = substr(ssn_char, i+&lt;/SPAN&gt;&lt;STRONG style="color: teal; font-size: 10pt; background: white; font-family: 'Courier New';"&gt;2&lt;/STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 10pt;"&gt;, &lt;/SPAN&gt;&lt;STRONG style="color: teal; font-size: 10pt; background: white; font-family: 'Courier New';"&gt;1&lt;/STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 10pt;"&gt;) = substr(ssn_char, i+&lt;/SPAN&gt;&lt;STRONG style="color: teal; font-size: 10pt; background: white; font-family: 'Courier New';"&gt;3&lt;/STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 10pt;"&gt;, &lt;/SPAN&gt;&lt;STRONG style="color: teal; font-size: 10pt; background: white; font-family: 'Courier New';"&gt;1&lt;/STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 10pt;"&gt;)&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-family: 'Courier New'; background: white; color: blue; font-size: 10pt;"&gt;then&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 10pt;"&gt; flag=&lt;/SPAN&gt;&lt;STRONG style="color: teal; font-size: 10pt; background: white; font-family: 'Courier New';"&gt;1&lt;/STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 10pt;"&gt;; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt; &lt;SPAN style="font-family: 'Courier New'; background: white; color: blue; font-size: 10pt;"&gt;if&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 10pt;"&gt; flag = &lt;/SPAN&gt;&lt;STRONG style="color: teal; font-size: 10pt; background: white; font-family: 'Courier New';"&gt;1&lt;/STRONG&gt; &lt;SPAN style="font-family: 'Courier New'; background: white; color: blue; font-size: 10pt;"&gt;then&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 10pt;"&gt; ssn_rept_chars = ssn_char;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;SPAN style="font-family: 'Courier New'; background: white; color: blue; font-size: 10pt;"&gt;end&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 10pt;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: navy; font-size: 10pt; background: white; font-family: 'Courier New';"&gt;run&lt;/STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 10pt;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 02 Apr 2015 18:31:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-identify-repeating-characters-in-the-string/m-p/211153#M52185</guid>
      <dc:creator>pr1</dc:creator>
      <dc:date>2015-04-02T18:31:11Z</dc:date>
    </item>
  </channel>
</rss>

