<?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: sas macro and wilcard in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/sas-macro-and-wilcard/m-p/502267#M134058</link>
    <description>&lt;P&gt;It is a pain trying to do that in macro language, but since you are already generating some SAS code why not generate some SAS code to add the quotes and percent signs?&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data _null_;
  call symputx('catg0_like',quote('%'||symget('catg0')||'%',"'"));
run;

proc sql noprint feedback;
create table XYU as 
  select a.* 
  from tableb a
  where companyname like &amp;amp;catg0_like
;
quit;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Sun, 07 Oct 2018 18:24:07 GMT</pubDate>
    <dc:creator>Tom</dc:creator>
    <dc:date>2018-10-07T18:24:07Z</dc:date>
    <item>
      <title>sas macro and wilcard</title>
      <link>https://communities.sas.com/t5/SAS-Programming/sas-macro-and-wilcard/m-p/501028#M133533</link>
      <description>&lt;P&gt;%let catg0 =&amp;nbsp;COMPANY ABC;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc sql;&lt;/P&gt;&lt;P&gt;create table XYU&lt;/P&gt;&lt;P&gt;as select&lt;/P&gt;&lt;P&gt;a.* from&amp;nbsp;&lt;/P&gt;&lt;P&gt;tableb a&lt;/P&gt;&lt;P&gt;where companyname like %nrstr(%')%str(%%)&amp;amp;&amp;amp;catg0%nrstr(%%)%str(%'));&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How do I make it resolve to :&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;where companyname like&amp;nbsp;&lt;/SPAN&gt;'%COMPANY ABC%'&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 03 Oct 2018 04:36:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/sas-macro-and-wilcard/m-p/501028#M133533</guid>
      <dc:creator>JohnnySas</dc:creator>
      <dc:date>2018-10-03T04:36:55Z</dc:date>
    </item>
    <item>
      <title>Re: sas macro and wilcard</title>
      <link>https://communities.sas.com/t5/SAS-Programming/sas-macro-and-wilcard/m-p/501030#M133534</link>
      <description>&lt;P&gt;There may be better ways but this works:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;where name like %unquote(%nrbquote('%str(%%)%superq(catg0)%'));&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 03 Oct 2018 05:44:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/sas-macro-and-wilcard/m-p/501030#M133534</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2018-10-03T05:44:08Z</dc:date>
    </item>
    <item>
      <title>Re: sas macro and wilcard</title>
      <link>https://communities.sas.com/t5/SAS-Programming/sas-macro-and-wilcard/m-p/501036#M133538</link>
      <description>&lt;P&gt;Couldn't that be solved by&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data xyu;
set tableb;
where index(companyname,"&amp;amp;catg0.");
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;?&lt;/P&gt;</description>
      <pubDate>Wed, 03 Oct 2018 06:50:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/sas-macro-and-wilcard/m-p/501036#M133538</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2018-10-03T06:50:56Z</dc:date>
    </item>
    <item>
      <title>Re: sas macro and wilcard</title>
      <link>https://communities.sas.com/t5/SAS-Programming/sas-macro-and-wilcard/m-p/501041#M133540</link>
      <description>&lt;P&gt;Or use a function:&lt;/P&gt;
&lt;PRE&gt;where index(companyname,"&amp;amp;catg0.");

&lt;/PRE&gt;</description>
      <pubDate>Wed, 03 Oct 2018 07:24:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/sas-macro-and-wilcard/m-p/501041#M133540</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2018-10-03T07:24:41Z</dc:date>
    </item>
    <item>
      <title>Re: sas macro and wilcard</title>
      <link>https://communities.sas.com/t5/SAS-Programming/sas-macro-and-wilcard/m-p/502171#M134021</link>
      <description>&lt;P&gt;Thank YOu. This worked for me&lt;/P&gt;</description>
      <pubDate>Sat, 06 Oct 2018 21:06:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/sas-macro-and-wilcard/m-p/502171#M134021</guid>
      <dc:creator>JohnnySas</dc:creator>
      <dc:date>2018-10-06T21:06:19Z</dc:date>
    </item>
    <item>
      <title>Re: sas macro and wilcard</title>
      <link>https://communities.sas.com/t5/SAS-Programming/sas-macro-and-wilcard/m-p/502267#M134058</link>
      <description>&lt;P&gt;It is a pain trying to do that in macro language, but since you are already generating some SAS code why not generate some SAS code to add the quotes and percent signs?&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data _null_;
  call symputx('catg0_like',quote('%'||symget('catg0')||'%',"'"));
run;

proc sql noprint feedback;
create table XYU as 
  select a.* 
  from tableb a
  where companyname like &amp;amp;catg0_like
;
quit;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sun, 07 Oct 2018 18:24:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/sas-macro-and-wilcard/m-p/502267#M134058</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2018-10-07T18:24:07Z</dc:date>
    </item>
  </channel>
</rss>

