<?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 serach for a text and assign a value in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/how-to-serach-for-a-text-and-assign-a-value/m-p/327092#M72938</link>
    <description>&lt;P&gt;I think you may be looking for this:&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="SAS Monospace" size="2"&gt;if&lt;/FONT&gt;&lt;FONT face="SAS Monospace" size="2"&gt; indexw(upcase(Message),&lt;/FONT&gt;&lt;FONT color="#800080" face="SAS Monospace" size="2"&gt;"CHROME",'&amp;amp;'&lt;/FONT&gt;&lt;FONT face="SAS Monospace" size="2"&gt;)&amp;gt;&lt;/FONT&gt;&lt;FONT color="#008080" face="SAS Monospace" size="2"&gt;0&lt;/FONT&gt; &lt;FONT color="#0000ff" face="SAS Monospace" size="2"&gt;then&lt;/FONT&gt;&lt;FONT face="SAS Monospace" size="2"&gt; flag=&lt;/FONT&gt;&lt;FONT color="#800080" face="SAS Monospace" size="2"&gt;"chrome"&lt;/FONT&gt;&lt;FONT face="SAS Monospace" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="SAS Monospace" size="2"&gt;Since this looks like unstructured text the upcase and the searched for word in upper case may work better if you want to find Chrome, CHROME, CHrome, cHrome and such. I recommend a similar UPCASE approach with the IE9 search as you may have folks enter ie9. &lt;/FONT&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 24 Jan 2017 16:00:11 GMT</pubDate>
    <dc:creator>ballardw</dc:creator>
    <dc:date>2017-01-24T16:00:11Z</dc:date>
    <item>
      <title>how to serach for a text and assign a value</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-serach-for-a-text-and-assign-a-value/m-p/327085#M72935</link>
      <description>&lt;P&gt;I have a an excel which contains extra character. How to serach for a specific strung and create another column to assign those value.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is a sample example.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;STRONG&gt;data&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; check;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;input&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; Message&lt;/FONT&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;$40.&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; ID ;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;cards&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;this&amp;amp;is&amp;amp;the&amp;amp;season&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;&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; 2&lt;/P&gt;&lt;P&gt;chrome&amp;amp;is&amp;amp;powerful&amp;amp;chrome&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;4&lt;/P&gt;&lt;P&gt;chrome&amp;amp;is&amp;amp;causing&amp;amp;the&amp;amp;Error&amp;amp;chrome.&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;the&amp;amp;service&amp;amp;center&amp;amp;is&amp;amp;causing&amp;amp;the&amp;amp;Error.&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;5&lt;/P&gt;&lt;P&gt;the&amp;amp;error&amp;amp;is&amp;amp;comming&amp;amp;from&amp;amp;IE9&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;6&lt;/P&gt;&lt;P&gt;the &amp;amp;error&amp;amp;is&amp;amp;comming&amp;amp;from&amp;amp;chrome&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; 7&lt;/P&gt;&lt;P&gt;chrome&amp;amp;is&amp;amp;causing&amp;amp;the&amp;amp;Error&amp;amp;IE9 .&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; 9&lt;/P&gt;&lt;P&gt;the&amp;amp;service&amp;amp;center&amp;amp;is&amp;amp;causing&amp;amp;the&amp;amp;Error.&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;10&lt;/P&gt;&lt;P&gt;the&amp;amp;error&amp;amp;is&amp;amp;comming&amp;amp;from&amp;amp;IE9&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; 11&lt;/P&gt;&lt;P&gt;the&amp;amp;error&amp;amp;is&amp;amp;comming&amp;amp;from&amp;amp;chrome&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;12&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;STRONG&gt;data&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; check2;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;set&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; check;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;if&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; Message=&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;"chrome"&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="2"&gt;then&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; flag=&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;"chorme"&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;if&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; Message=&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;"IE9"&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="2"&gt;then&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; flag=&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;"IE9"&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;else&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; flag=&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;""&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 24 Jan 2017 15:46:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-serach-for-a-text-and-assign-a-value/m-p/327085#M72935</guid>
      <dc:creator>tekish</dc:creator>
      <dc:date>2017-01-24T15:46:54Z</dc:date>
    </item>
    <item>
      <title>Re: how to serach for a text and assign a value</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-serach-for-a-text-and-assign-a-value/m-p/327089#M72936</link>
      <description>&lt;P&gt;try using a CASE statement with LIKE in case you wanted to match any value within a string. Hope the below example sheds some light.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data check;
input Message$40. ID ;
cards;
this&amp;amp;is&amp;amp;the&amp;amp;season                                               2
chrome&amp;amp;is&amp;amp;powerful&amp;amp;chrome                               4
chrome&amp;amp;is&amp;amp;causing&amp;amp;the&amp;amp;Error&amp;amp;chrome.             3
the&amp;amp;service&amp;amp;center&amp;amp;is&amp;amp;causing&amp;amp;the&amp;amp;Error.        5
the&amp;amp;error&amp;amp;is&amp;amp;comming&amp;amp;from&amp;amp;IE9                        6
the &amp;amp;error&amp;amp;is&amp;amp;comming&amp;amp;from&amp;amp;chrome                7
chrome&amp;amp;is&amp;amp;causing&amp;amp;the&amp;amp;Error&amp;amp;IE9 .                  9
the&amp;amp;service&amp;amp;center&amp;amp;is&amp;amp;causing&amp;amp;the&amp;amp;Error.      10
the&amp;amp;error&amp;amp;is&amp;amp;comming&amp;amp;from&amp;amp;IE9                      11
the&amp;amp;error&amp;amp;is&amp;amp;comming&amp;amp;from&amp;amp;chrome               12
;
run;

proc sql ;
select 
case  
when Message like "%chrome%" then "chorme"
when Message like "%IE9%" then "IE9"
else "None" 
end as flag,ID
from check;
quit ;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 24 Jan 2017 15:55:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-serach-for-a-text-and-assign-a-value/m-p/327089#M72936</guid>
      <dc:creator>anoopmohandas7</dc:creator>
      <dc:date>2017-01-24T15:55:28Z</dc:date>
    </item>
    <item>
      <title>Re: how to serach for a text and assign a value</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-serach-for-a-text-and-assign-a-value/m-p/327092#M72938</link>
      <description>&lt;P&gt;I think you may be looking for this:&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="SAS Monospace" size="2"&gt;if&lt;/FONT&gt;&lt;FONT face="SAS Monospace" size="2"&gt; indexw(upcase(Message),&lt;/FONT&gt;&lt;FONT color="#800080" face="SAS Monospace" size="2"&gt;"CHROME",'&amp;amp;'&lt;/FONT&gt;&lt;FONT face="SAS Monospace" size="2"&gt;)&amp;gt;&lt;/FONT&gt;&lt;FONT color="#008080" face="SAS Monospace" size="2"&gt;0&lt;/FONT&gt; &lt;FONT color="#0000ff" face="SAS Monospace" size="2"&gt;then&lt;/FONT&gt;&lt;FONT face="SAS Monospace" size="2"&gt; flag=&lt;/FONT&gt;&lt;FONT color="#800080" face="SAS Monospace" size="2"&gt;"chrome"&lt;/FONT&gt;&lt;FONT face="SAS Monospace" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="SAS Monospace" size="2"&gt;Since this looks like unstructured text the upcase and the searched for word in upper case may work better if you want to find Chrome, CHROME, CHrome, cHrome and such. I recommend a similar UPCASE approach with the IE9 search as you may have folks enter ie9. &lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 24 Jan 2017 16:00:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-serach-for-a-text-and-assign-a-value/m-p/327092#M72938</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2017-01-24T16:00:11Z</dc:date>
    </item>
    <item>
      <title>Re: how to serach for a text and assign a value</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-serach-for-a-text-and-assign-a-value/m-p/327093#M72939</link>
      <description>&lt;P&gt;Waht do you want to do if both chrome and IE9 are present?&lt;/P&gt;</description>
      <pubDate>Tue, 24 Jan 2017 16:02:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-serach-for-a-text-and-assign-a-value/m-p/327093#M72939</guid>
      <dc:creator>mkeintz</dc:creator>
      <dc:date>2017-01-24T16:02:15Z</dc:date>
    </item>
  </channel>
</rss>

