<?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 Specifying a range of values for a character variable in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Specifying-a-range-of-values-for-a-character-variable/m-p/134562#M36508</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have a variable called "X", it has alphabets, numbers, special characters etc. I need to search for Upper and Lower Case alphabets from a to z and create a flag based on that. Whenever X has a character in it, a variable called flag should have value 1. Writing a if then statement is not an option cause its very long. I need to specify a variable with range of character values from A to Z and the variable flag should be based on that. Please help. Need a solution urgently.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 26 Apr 2014 12:30:03 GMT</pubDate>
    <dc:creator>ranjita</dc:creator>
    <dc:date>2014-04-26T12:30:03Z</dc:date>
    <item>
      <title>Specifying a range of values for a character variable</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Specifying-a-range-of-values-for-a-character-variable/m-p/134562#M36508</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have a variable called "X", it has alphabets, numbers, special characters etc. I need to search for Upper and Lower Case alphabets from a to z and create a flag based on that. Whenever X has a character in it, a variable called flag should have value 1. Writing a if then statement is not an option cause its very long. I need to specify a variable with range of character values from A to Z and the variable flag should be based on that. Please help. Need a solution urgently.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 26 Apr 2014 12:30:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Specifying-a-range-of-values-for-a-character-variable/m-p/134562#M36508</guid>
      <dc:creator>ranjita</dc:creator>
      <dc:date>2014-04-26T12:30:03Z</dc:date>
    </item>
    <item>
      <title>Re: Specifying a range of values for a character variable</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Specifying-a-range-of-values-for-a-character-variable/m-p/134563#M36509</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I would think that you could write an if statement that includes some of the SAS ANY functions, e.g.: anyalpha, anyalnum, anycntrl, anydigit, anylower, anypunct and anyupper.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 26 Apr 2014 14:07:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Specifying-a-range-of-values-for-a-character-variable/m-p/134563#M36509</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2014-04-26T14:07:01Z</dc:date>
    </item>
    <item>
      <title>Re: Specifying a range of values for a character variable</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Specifying-a-range-of-values-for-a-character-variable/m-p/134564#M36510</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Some examples would clarify the question, but it sounds like you want the INDEXC() function.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; flag = &lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;indexc(upcase(x),'ABC');&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then FLAG will have the position where A,B or C first appear in X.&amp;nbsp; You could treat FLAG as a true/false variable if you want.&lt;/P&gt;&lt;P&gt;Or you could convert it to a 0/1 variable by using:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;flag = 0 ^= indexc(upcase(x),'ABC');&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;or&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;flag = not not indexc(upcase(x),'ABC');&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 26 Apr 2014 18:08:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Specifying-a-range-of-values-for-a-character-variable/m-p/134564#M36510</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2014-04-26T18:08:17Z</dc:date>
    </item>
  </channel>
</rss>

