<?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 How to check if a character variable consists of all same letters in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/How-to-check-if-a-character-variable-consists-of-all-same/m-p/26353#M6012</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This isn't an answer to your question (since the other two respondents gave solutions), but I just wanted to point out that if there is a possibility of pseudonyms like AAA, BBB, etc., I would assume there is also the possibility of pseudonyms like QWERTY, ASDFGH, 12345, etc. You are going to need a more elaborate filter than that (which can not possibly get rid of all pseudonyms without also potentially getting rid of some real names).&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 09 Jan 2012 15:45:19 GMT</pubDate>
    <dc:creator>DouglasMartin</dc:creator>
    <dc:date>2012-01-09T15:45:19Z</dc:date>
    <item>
      <title>How to check if a character variable consists of all same letters</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-check-if-a-character-variable-consists-of-all-same/m-p/26350#M6009</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, I have a character variable which is about the surname of people. Many respondents entered the names as AA, BBB or ZZZZ which mean that they are not real names. So these cases should be deleted.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Translating this question into this: how can I check if a character variable consists of all same letters? Note that the name has varying length.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks a lot for help.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 09 Jan 2012 12:59:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-check-if-a-character-variable-consists-of-all-same/m-p/26350#M6009</guid>
      <dc:creator>JamesKauley</dc:creator>
      <dc:date>2012-01-09T12:59:35Z</dc:date>
    </item>
    <item>
      <title>How to check if a character variable consists of all same letters</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-check-if-a-character-variable-consists-of-all-same/m-p/26351#M6010</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Here is one possibility:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data have;&lt;/P&gt;&lt;P&gt;&amp;nbsp; input name $20.;&lt;/P&gt;&lt;P&gt;&amp;nbsp; cards;&lt;/P&gt;&lt;P&gt;AA&lt;/P&gt;&lt;P&gt;BBB&lt;/P&gt;&lt;P&gt;ZZZZ&lt;/P&gt;&lt;P&gt;AABA&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; set have;&lt;/P&gt;&lt;P&gt;&amp;nbsp; array chars(20);&lt;/P&gt;&lt;P&gt;&amp;nbsp; do i=1 to length(name);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; chars(i)=rank(substr(name,i,1));&lt;/P&gt;&lt;P&gt;&amp;nbsp; end;&lt;/P&gt;&lt;P&gt;&amp;nbsp; if min(of chars(*)) ne max(of chars(*)) then keepit=1;&lt;/P&gt;&lt;P&gt;&amp;nbsp; if keepit;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 09 Jan 2012 13:39:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-check-if-a-character-variable-consists-of-all-same/m-p/26351#M6010</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2012-01-09T13:39:47Z</dc:date>
    </item>
    <item>
      <title>Re: How to check if a character variable consists of all same letters</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-check-if-a-character-variable-consists-of-all-same/m-p/26352#M6011</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; another way:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: navy; font-size: 10pt; background-color: white; font-family: 'Courier New';"&gt;data&lt;/STRONG&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt; have;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;SPAN style="background-color: white; font-family: 'Courier New'; color: blue; font-size: 10pt;"&gt;input&lt;/SPAN&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt; name &lt;/SPAN&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: teal; font-size: 10pt;"&gt;$20.&lt;/SPAN&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;SPAN style="background-color: white; font-family: 'Courier New'; color: blue; font-size: 10pt;"&gt;cards&lt;/SPAN&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffc0; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt;AA&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffc0; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt;BBB&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffc0; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt;ZZZZ&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffc0; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt;AABA&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: navy; font-size: 10pt; background-color: white; font-family: 'Courier New';"&gt;data&lt;/STRONG&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt; want;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;SPAN style="background-color: white; font-family: 'Courier New'; color: blue; font-size: 10pt;"&gt;set&lt;/SPAN&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt; have;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt;&amp;nbsp; flag=compress(name,substr(name,&lt;/SPAN&gt;&lt;STRONG style="color: teal; font-size: 10pt; background-color: white; font-family: 'Courier New';"&gt;1&lt;/STRONG&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt;,&lt;/SPAN&gt;&lt;STRONG style="color: teal; font-size: 10pt; background-color: white; font-family: 'Courier New';"&gt;1&lt;/STRONG&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt;));&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;SPAN style="background-color: white; font-family: 'Courier New'; color: blue; font-size: 10pt;"&gt;if&lt;/SPAN&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt; flag ne &lt;/SPAN&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: purple; font-size: 10pt;"&gt;' '&lt;/SPAN&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: navy; font-size: 10pt; background-color: white; font-family: 'Courier New';"&gt;run&lt;/STRONG&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: navy; font-size: 10pt; background-color: white; font-family: 'Courier New';"&gt;proc&lt;/STRONG&gt; &lt;STRONG style="color: navy; font-size: 10pt; background-color: white; font-family: 'Courier New';"&gt;print&lt;/STRONG&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: navy; font-size: 10pt; background-color: white; font-family: 'Courier New';"&gt;run&lt;/STRONG&gt;;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Linlin&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 09 Jan 2012 14:08:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-check-if-a-character-variable-consists-of-all-same/m-p/26352#M6011</guid>
      <dc:creator>Linlin</dc:creator>
      <dc:date>2012-01-09T14:08:34Z</dc:date>
    </item>
    <item>
      <title>How to check if a character variable consists of all same letters</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-check-if-a-character-variable-consists-of-all-same/m-p/26353#M6012</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This isn't an answer to your question (since the other two respondents gave solutions), but I just wanted to point out that if there is a possibility of pseudonyms like AAA, BBB, etc., I would assume there is also the possibility of pseudonyms like QWERTY, ASDFGH, 12345, etc. You are going to need a more elaborate filter than that (which can not possibly get rid of all pseudonyms without also potentially getting rid of some real names).&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 09 Jan 2012 15:45:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-check-if-a-character-variable-consists-of-all-same/m-p/26353#M6012</guid>
      <dc:creator>DouglasMartin</dc:creator>
      <dc:date>2012-01-09T15:45:19Z</dc:date>
    </item>
  </channel>
</rss>

