<?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: PROC SQL CONTAINS doesnt give me the desire result in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/PROC-SQL-CONTAINS-doesnt-give-me-the-desire-result/m-p/520235#M141040</link>
    <description>&lt;P&gt;&lt;EM&gt;&amp;nbsp;I still get the same result set(FULL) if i use that.&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;No you don't.&lt;/SPAN&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data HAVE;
 input (PMU  SSU   ASSETFLAG   TYPE) (&amp;amp; $);
 cards;
aa     bb    bb cc dd    cc
11     22    22 33 44    44
xx     yy    yy zz pp    pp
ee     ff     ff gg hh   ee
run;
proc sql;
 select * from HAVE where ASSETFLAG contains strip(TYPE);
quit

&lt;/CODE&gt;&lt;/PRE&gt;
&lt;DIV class="branch"&gt;
&lt;DIV&gt;
&lt;DIV align="center"&gt;
&lt;TABLE class="table" summary="Procedure SQL: Query Results" frame="box" rules="all" cellspacing="0" cellpadding="5"&gt;&lt;COLGROUP&gt; &lt;COL /&gt; &lt;COL /&gt; &lt;COL /&gt; &lt;COL /&gt;&lt;/COLGROUP&gt;
&lt;THEAD&gt;
&lt;TR&gt;
&lt;TH class="l b header" scope="col"&gt;PMU&lt;/TH&gt;
&lt;TH class="l b header" scope="col"&gt;SSU&lt;/TH&gt;
&lt;TH class="l b header" scope="col"&gt;ASSETFLAG&lt;/TH&gt;
&lt;TH class="l b header" scope="col"&gt;TYPE&lt;/TH&gt;
&lt;/TR&gt;
&lt;/THEAD&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD class="l data"&gt;aa&lt;/TD&gt;
&lt;TD class="l data"&gt;bb&lt;/TD&gt;
&lt;TD class="l data"&gt;bb cc dd&lt;/TD&gt;
&lt;TD class="l data"&gt;cc&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD class="l data"&gt;11&lt;/TD&gt;
&lt;TD class="l data"&gt;22&lt;/TD&gt;
&lt;TD class="l data"&gt;22 33 44&lt;/TD&gt;
&lt;TD class="l data"&gt;44&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD class="l data"&gt;xx&lt;/TD&gt;
&lt;TD class="l data"&gt;yy&lt;/TD&gt;
&lt;TD class="l data"&gt;yy zz pp&lt;/TD&gt;
&lt;TD class="l data"&gt;pp&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 11 Dec 2018 03:40:27 GMT</pubDate>
    <dc:creator>ChrisNZ</dc:creator>
    <dc:date>2018-12-11T03:40:27Z</dc:date>
    <item>
      <title>PROC SQL CONTAINS doesnt give me the desire result</title>
      <link>https://communities.sas.com/t5/SAS-Programming/PROC-SQL-CONTAINS-doesnt-give-me-the-desire-result/m-p/520229#M141036</link>
      <description>&lt;P&gt;Hi everyone, i tried to filter some data that i want within a dataset. Lets have a look at the same data:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;P&gt;Table A&lt;/P&gt;&lt;P&gt;pmu&amp;nbsp; ssu&amp;nbsp; &amp;nbsp;assetflag&amp;nbsp; &amp;nbsp;type&lt;/P&gt;&lt;P&gt;aa&amp;nbsp; &amp;nbsp; &amp;nbsp;bb&amp;nbsp; &amp;nbsp; bb cc dd&amp;nbsp; &amp;nbsp; cc&lt;/P&gt;&lt;P&gt;11&amp;nbsp; &amp;nbsp; &amp;nbsp;22&amp;nbsp; &amp;nbsp; 22 33 44&amp;nbsp; &amp;nbsp; 44&lt;/P&gt;&lt;P&gt;xx&amp;nbsp; &amp;nbsp; &amp;nbsp;yy&amp;nbsp; &amp;nbsp; &amp;nbsp;yy zz pp&amp;nbsp; &amp;nbsp; pp&lt;/P&gt;&lt;P&gt;ee&amp;nbsp; &amp;nbsp; &amp;nbsp;ff&amp;nbsp; &amp;nbsp; &amp;nbsp; ff gg hh&amp;nbsp; &amp;nbsp; &amp;nbsp;ee&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want to filter out data that "type" has in "assetflag".&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My SQL Statement:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql;
select * from a
where
assetflag contains type;
quit;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However, i do not see the result at all. 0 records.&lt;/P&gt;&lt;P&gt;What is wrong? BTW, i remember seeing someone posted that CONTAINS to follow with &amp;amp;&amp;amp;&amp;amp;.....however, i think that only applies to macro variable. Correct me if im wrong&lt;/P&gt;</description>
      <pubDate>Tue, 11 Dec 2018 03:21:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/PROC-SQL-CONTAINS-doesnt-give-me-the-desire-result/m-p/520229#M141036</guid>
      <dc:creator>imdickson</dc:creator>
      <dc:date>2018-12-11T03:21:32Z</dc:date>
    </item>
    <item>
      <title>Re: PROC SQL CONTAINS doesnt give me the desire result</title>
      <link>https://communities.sas.com/t5/SAS-Programming/PROC-SQL-CONTAINS-doesnt-give-me-the-desire-result/m-p/520231#M141037</link>
      <description>&lt;P&gt;What happens if you use&amp;nbsp;&lt;/P&gt;
&lt;PRE class=" language-sas"&gt;&lt;CODE class="  language-sas"&gt;where ASSETFLAG contains strip(TYPE)&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;?&lt;/P&gt;</description>
      <pubDate>Tue, 11 Dec 2018 03:27:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/PROC-SQL-CONTAINS-doesnt-give-me-the-desire-result/m-p/520231#M141037</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2018-12-11T03:27:26Z</dc:date>
    </item>
    <item>
      <title>Re: PROC SQL CONTAINS doesnt give me the desire result</title>
      <link>https://communities.sas.com/t5/SAS-Programming/PROC-SQL-CONTAINS-doesnt-give-me-the-desire-result/m-p/520234#M141039</link>
      <description>&lt;P&gt;It seems to me the filter with that statement will not have any effect at all. I still get the same result set(FULL) if i use that.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;DO i need to wrap both side of the variable with double quote?&lt;/P&gt;</description>
      <pubDate>Tue, 11 Dec 2018 03:36:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/PROC-SQL-CONTAINS-doesnt-give-me-the-desire-result/m-p/520234#M141039</guid>
      <dc:creator>imdickson</dc:creator>
      <dc:date>2018-12-11T03:36:04Z</dc:date>
    </item>
    <item>
      <title>Re: PROC SQL CONTAINS doesnt give me the desire result</title>
      <link>https://communities.sas.com/t5/SAS-Programming/PROC-SQL-CONTAINS-doesnt-give-me-the-desire-result/m-p/520235#M141040</link>
      <description>&lt;P&gt;&lt;EM&gt;&amp;nbsp;I still get the same result set(FULL) if i use that.&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;No you don't.&lt;/SPAN&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data HAVE;
 input (PMU  SSU   ASSETFLAG   TYPE) (&amp;amp; $);
 cards;
aa     bb    bb cc dd    cc
11     22    22 33 44    44
xx     yy    yy zz pp    pp
ee     ff     ff gg hh   ee
run;
proc sql;
 select * from HAVE where ASSETFLAG contains strip(TYPE);
quit

&lt;/CODE&gt;&lt;/PRE&gt;
&lt;DIV class="branch"&gt;
&lt;DIV&gt;
&lt;DIV align="center"&gt;
&lt;TABLE class="table" summary="Procedure SQL: Query Results" frame="box" rules="all" cellspacing="0" cellpadding="5"&gt;&lt;COLGROUP&gt; &lt;COL /&gt; &lt;COL /&gt; &lt;COL /&gt; &lt;COL /&gt;&lt;/COLGROUP&gt;
&lt;THEAD&gt;
&lt;TR&gt;
&lt;TH class="l b header" scope="col"&gt;PMU&lt;/TH&gt;
&lt;TH class="l b header" scope="col"&gt;SSU&lt;/TH&gt;
&lt;TH class="l b header" scope="col"&gt;ASSETFLAG&lt;/TH&gt;
&lt;TH class="l b header" scope="col"&gt;TYPE&lt;/TH&gt;
&lt;/TR&gt;
&lt;/THEAD&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD class="l data"&gt;aa&lt;/TD&gt;
&lt;TD class="l data"&gt;bb&lt;/TD&gt;
&lt;TD class="l data"&gt;bb cc dd&lt;/TD&gt;
&lt;TD class="l data"&gt;cc&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD class="l data"&gt;11&lt;/TD&gt;
&lt;TD class="l data"&gt;22&lt;/TD&gt;
&lt;TD class="l data"&gt;22 33 44&lt;/TD&gt;
&lt;TD class="l data"&gt;44&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD class="l data"&gt;xx&lt;/TD&gt;
&lt;TD class="l data"&gt;yy&lt;/TD&gt;
&lt;TD class="l data"&gt;yy zz pp&lt;/TD&gt;
&lt;TD class="l data"&gt;pp&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 11 Dec 2018 03:40:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/PROC-SQL-CONTAINS-doesnt-give-me-the-desire-result/m-p/520235#M141040</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2018-12-11T03:40:27Z</dc:date>
    </item>
  </channel>
</rss>

