<?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: Check that a string contains only (type of) character in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Check-that-a-string-contains-only-type-of-character/m-p/391801#M94183</link>
    <description>&lt;PRE&gt;
data have;
x="22313";output;
x="4525234";output;
x="33333";output;
run;
data want;
 set have;
 if verify(strip(x),'3') then flag='no ';
  else flag='yes';
run;


&lt;/PRE&gt;</description>
    <pubDate>Wed, 30 Aug 2017 12:39:01 GMT</pubDate>
    <dc:creator>Ksharp</dc:creator>
    <dc:date>2017-08-30T12:39:01Z</dc:date>
    <item>
      <title>Check that a string contains only (type of) character</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Check-that-a-string-contains-only-type-of-character/m-p/391719#M94153</link>
      <description>&lt;P&gt;Just wondering if there's a single function that will tell me whether a string contains &lt;U&gt;only&lt;/U&gt; a specific characater. For example, if I have strings that are number codes of different lengths (e.g., "22313", "4525234", "33232") how can I flag ones that only contain "3"s in&amp;nbsp;them (so &lt;EM&gt;&lt;U&gt;yes&lt;/U&gt; &lt;/EM&gt;to "3", "33", "333" and so on but &lt;EM&gt;no&lt;/EM&gt; to "313", "3333313", "3338")?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 30 Aug 2017 03:54:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Check-that-a-string-contains-only-type-of-character/m-p/391719#M94153</guid>
      <dc:creator>Riccardo</dc:creator>
      <dc:date>2017-08-30T03:54:58Z</dc:date>
    </item>
    <item>
      <title>Re: Check that a string contains only (type of) character</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Check-that-a-string-contains-only-type-of-character/m-p/391721#M94155</link>
      <description>&lt;P&gt;try the function index&amp;nbsp;&lt;A href="http://support.sas.com/publishing/pubcat/chaps/59343.pdf" target="_self"&gt;Character Functions&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 30 Aug 2017 04:06:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Check-that-a-string-contains-only-type-of-character/m-p/391721#M94155</guid>
      <dc:creator>Miracle</dc:creator>
      <dc:date>2017-08-30T04:06:39Z</dc:date>
    </item>
    <item>
      <title>Re: Check that a string contains only (type of) character</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Check-that-a-string-contains-only-type-of-character/m-p/391748#M94165</link>
      <description>&lt;P&gt;To check does a numric variable contains only "3"s you may try:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;if compress(var,'3') ne '' then ok; else not_ok;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 30 Aug 2017 07:48:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Check-that-a-string-contains-only-type-of-character/m-p/391748#M94165</guid>
      <dc:creator>Shmuel</dc:creator>
      <dc:date>2017-08-30T07:48:03Z</dc:date>
    </item>
    <item>
      <title>Re: Check that a string contains only (type of) character</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Check-that-a-string-contains-only-type-of-character/m-p/391801#M94183</link>
      <description>&lt;PRE&gt;
data have;
x="22313";output;
x="4525234";output;
x="33333";output;
run;
data want;
 set have;
 if verify(strip(x),'3') then flag='no ';
  else flag='yes';
run;


&lt;/PRE&gt;</description>
      <pubDate>Wed, 30 Aug 2017 12:39:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Check-that-a-string-contains-only-type-of-character/m-p/391801#M94183</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2017-08-30T12:39:01Z</dc:date>
    </item>
  </channel>
</rss>

