<?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: Find values that contain _ in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Find-values-that-contain/m-p/128147#M26183</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you are looking strings which contain a '_' at anywhere. using contains operation.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc sql;&lt;/P&gt;&lt;P&gt;create table x as &lt;/P&gt;&lt;P&gt; select a&lt;/P&gt;&lt;P&gt;&amp;nbsp; from a&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; where a contains "_" ;&amp;nbsp; &lt;/P&gt;&lt;P&gt;quit;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ksharp&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 29 May 2012 10:20:03 GMT</pubDate>
    <dc:creator>Ksharp</dc:creator>
    <dc:date>2012-05-29T10:20:03Z</dc:date>
    <item>
      <title>Find values that contain _</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Find-values-that-contain/m-p/128145#M26181</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;STRONG style=": ; mso-fareast-language: DE; color: black; background: white; font-size: 10pt; font-family: 'Courier New';"&gt;Hello friends,&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style=": ; mso-fareast-language: DE; color: black; background: white; font-size: 10pt; font-family: 'Courier New';"&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 10pt; mso-fareast-language: DE;"&gt;I am using the following code to find&lt;/SPAN&gt; values that contain _&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style=": ; mso-fareast-language: DE; color: black; background: white; font-size: 10pt; font-family: 'Courier New';"&gt;------------------------------------------------------------&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="mso-fareast-language: DE; color: black; font-size: 10pt; background: white; font-family: 'Courier New';"&gt;proc sql;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #008080; font-size: 10pt; font-family: Courier New;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="line-height: normal; margin: 0cm 0cm 0pt; mso-layout-grid-align: none;"&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 10pt; mso-fareast-language: DE;"&gt;/* Ausgabe der KontoIDs, in denen noch Suffices vorhanden sind*/&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="line-height: normal; margin: 0cm 0cm 0pt; mso-layout-grid-align: none;"&gt;&lt;SPAN lang="EN-GB" style="font-family: 'Courier New'; background: white; color: black; font-size: 10pt; mso-fareast-language: DE; mso-ansi-language: EN-GB;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="line-height: normal; margin: 0cm 0cm 0pt; mso-layout-grid-align: none;"&gt;&lt;SPAN lang="EN-GB" style="font-family: 'Courier New'; background: white; color: black; font-size: 10pt; mso-fareast-language: DE; mso-ansi-language: EN-GB;"&gt;create table lls_dat.p_Ktomitsuff&amp;amp;stichtag&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="line-height: normal; margin: 0cm 0cm 0pt; mso-layout-grid-align: none;"&gt;&lt;SPAN lang="EN-GB" style="font-family: 'Courier New'; background: white; color: black; font-size: 10pt; mso-fareast-language: DE; mso-ansi-language: EN-GB;"&gt;as select KontoID, KontOhneSuffix&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="line-height: normal; margin: 0cm 0cm 0pt; mso-layout-grid-align: none;"&gt;&lt;SPAN lang="EN-GB" style="font-family: 'Courier New'; background: white; color: black; font-size: 10pt; mso-fareast-language: DE; mso-ansi-language: EN-GB;"&gt;from lls_wrk.P_kos&amp;amp;stichtag&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="line-height: normal; margin: 0cm 0cm 0pt; mso-layout-grid-align: none;"&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 10pt; mso-fareast-language: DE;"&gt;where kontohneSuffix like "^_" escape "^";&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P class="MsoNormal" style="line-height: normal; margin: 0cm 0cm 0pt; mso-layout-grid-align: none;"&gt;&lt;SPAN lang="EN-GB" style="font-family: 'Courier New'; background: white; color: black; font-size: 10pt; mso-fareast-language: DE; mso-ansi-language: EN-GB;"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="line-height: normal; margin: 0cm 0cm 0pt; mso-layout-grid-align: none;"&gt;&lt;SPAN style="mso-fareast-language: DE; color: black; font-size: 10pt; background: white; font-family: 'Courier New';"&gt;quit;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="MsoNormal"&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="line-height: normal; margin: 0cm 0cm 0pt; mso-layout-grid-align: none;"&gt;&lt;SPAN style="mso-fareast-language: DE; color: black; font-size: 10pt; background: white; font-family: 'Courier New';"&gt;------------------------------------------------------------&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="line-height: normal; margin: 0cm 0cm 0pt; mso-layout-grid-align: none;"&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 10pt; mso-fareast-language: DE;"&gt;&lt;STRONG style=": ; mso-fareast-language: DE; color: black; background: white; font-size: 10pt; font-family: 'Courier New';"&gt;I am getting the following warning. How can I make it work?&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="line-height: normal; margin: 0cm 0cm 0pt; mso-layout-grid-align: none;"&gt; &lt;/P&gt;&lt;P class="MsoNormal" style="line-height: normal; margin: 0cm 0cm 0pt; mso-layout-grid-align: none;"&gt;&lt;SPAN style="mso-fareast-language: DE; color: black; font-size: 10pt; background: white; font-family: 'Courier New';"&gt;&lt;STRONG style=": ; mso-fareast-language: DE; color: black; background: white; font-size: 10pt; font-family: 'Courier New';"&gt;Thx, Stefan&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="line-height: normal; margin: 0cm 0cm 0pt; mso-layout-grid-align: none;"&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="mso-fareast-language: DE; color: black; font-size: 10pt; background: white; font-family: 'Courier New';"&gt;------------------------------------------------------------&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="line-height: normal; margin: 0cm 0cm 0pt; mso-layout-grid-align: none;"&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="margin: 0cm 0cm 0pt;"&gt;&lt;STRONG&gt;&lt;SPAN lang="EN-GB" style="font-family: 'Courier New'; background: white; color: teal; font-size: 10pt; mso-fareast-language: DE; mso-ansi-language: EN-GB;"&gt;WARNING: Server is unable to execute the WHERE clause.&lt;/SPAN&gt;&lt;SPAN lang="EN-GB" style="mso-ansi-language: EN-GB;"&gt;&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 29 May 2012 10:03:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Find-values-that-contain/m-p/128145#M26181</guid>
      <dc:creator>sfmeier</dc:creator>
      <dc:date>2012-05-29T10:03:12Z</dc:date>
    </item>
    <item>
      <title>Re: Find values that contain _</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Find-values-that-contain/m-p/128146#M26182</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi. Stefan&lt;/P&gt;&lt;P&gt;Are you finding a string which ends with underline '_' ?&lt;/P&gt;&lt;P&gt;It seems that you need another wildcard % to match any characters before '_' .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;data a;
a='sdsad_';output;
a='sdsdfs';output;
run;

proc sql;
create table x as 
 select a
&amp;nbsp; from a
&amp;nbsp;&amp;nbsp; where a like "%^_" escape "^";&amp;nbsp; 
quit;
&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ksharp&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 29 May 2012 10:17:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Find-values-that-contain/m-p/128146#M26182</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2012-05-29T10:17:03Z</dc:date>
    </item>
    <item>
      <title>Re: Find values that contain _</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Find-values-that-contain/m-p/128147#M26183</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you are looking strings which contain a '_' at anywhere. using contains operation.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc sql;&lt;/P&gt;&lt;P&gt;create table x as &lt;/P&gt;&lt;P&gt; select a&lt;/P&gt;&lt;P&gt;&amp;nbsp; from a&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; where a contains "_" ;&amp;nbsp; &lt;/P&gt;&lt;P&gt;quit;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ksharp&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 29 May 2012 10:20:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Find-values-that-contain/m-p/128147#M26183</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2012-05-29T10:20:03Z</dc:date>
    </item>
  </channel>
</rss>

