<?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 suppress macro resolution in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-to-suppress-macro-resolution/m-p/691672#M210554</link>
    <description>Without seeing more of the code I can't answer. I don't know how you're passing parameters or using the values. DB2 does support regex from what I can see.&lt;BR /&gt;&lt;BR /&gt;&lt;A href="https://www.ibm.com/support/producthub/db2/docs/content/SSEPGG_11.5.0/com.ibm.db2.luw.sql.ref.doc/doc/r0061494.html?pos=2" target="_blank"&gt;https://www.ibm.com/support/producthub/db2/docs/content/SSEPGG_11.5.0/com.ibm.db2.luw.sql.ref.doc/doc/r0061494.html?pos=2&lt;/A&gt;</description>
    <pubDate>Wed, 14 Oct 2020 20:47:05 GMT</pubDate>
    <dc:creator>Reeza</dc:creator>
    <dc:date>2020-10-14T20:47:05Z</dc:date>
    <item>
      <title>How to suppress macro resolution</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-suppress-macro-resolution/m-p/691636#M210530</link>
      <description>&lt;P&gt;I am passing a variable to a macro that will be used as a SQL LIKE predicate, so it can contain the % character, but I can't seem to get the macro to bypass the resolution attempt.&amp;nbsp; At best this is a warning message, but if the data actually matches a macro name, it will be an error.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The variable contains a list of character values, separated by spaces, one or more of which could contain a %.&amp;nbsp; I first convert the % to an asterisks in an attempt to get around the macro resolution problem:&lt;/P&gt;&lt;P&gt;P*TZ P*T1&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The above value needs to be converted to 2 SQL LIKE predicates:&lt;/P&gt;&lt;P&gt;and (cics like "P%TZ" &amp;nbsp;or cics like "P%T1")&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The variable name is ACICS.&amp;nbsp; Since I convert the % to * outside of the macro, I now have to convert it back to % in the macro (I've tried not converting as well).&amp;nbsp; Here's the macro code:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%if %length(&amp;amp;acics) &amp;gt; 1 %then
%do;
and (
%let acics=%sysfunc(translate(&amp;amp;acics,%NRSTR(%_),%NRSTR(*+)));
%do i=1 %to %sysfunc(countw(%superq(acics),' '));
%if &amp;amp;i &amp;gt; 1 %then or;
CICS like "%scan(%superq(acics),&amp;amp;i,' ')"
%end;) %end;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I get these messages with MLOGIC and SYMBOLGEN enabled showing the warnings:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;MLOGIC(FRITZ): %IF condition %length(&amp;amp;acics) &amp;gt; 1 is TRUE&lt;BR /&gt;MLOGIC(FRITZ): %LET (variable name is ACICS)&lt;BR /&gt;SYMBOLGEN: Macro variable ACICS resolves to P*TZ P*T1&lt;BR /&gt;&lt;STRONG&gt;WARNING: Apparent invocation of macro TZ not resolved. &lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;WARNING: Apparent invocation of macro T1 not resolved.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;MLOGIC(FRITZ): %DO loop beginning; index variable I; start value is 1; stop value is 2; by value is 1.&lt;BR /&gt;SYMBOLGEN: Macro variable I resolves to 1&lt;BR /&gt;MLOGIC(FRITZ): %IF condition &amp;amp;i &amp;gt; 1 is FALSE&lt;BR /&gt;SYMBOLGEN: Macro variable I resolves to 1&lt;BR /&gt;&lt;STRONG&gt;WARNING: Apparent invocation of macro TZ not resolved.&lt;/STRONG&gt;&lt;BR /&gt;MLOGIC(FRITZ): %DO loop index variable I is now 2; loop will iterate again.&lt;BR /&gt;SYMBOLGEN: Macro variable I resolves to 2&lt;BR /&gt;MLOGIC(FRITZ): %IF condition &amp;amp;i &amp;gt; 1 is TRUE&lt;BR /&gt;SYMBOLGEN: Macro variable I resolves to 2&lt;BR /&gt;&lt;STRONG&gt;WARNING: Apparent invocation of macro T1 not resolved.&lt;/STRONG&gt;&lt;BR /&gt;MLOGIC(FRITZ): %DO loop index variable I is now 3; loop will not iterate again.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The generated code comes out good, but, I still get the warnings:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;and ( cics like "P%TZ" or cics like "P%T1") ;   &lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Does anyone have any suggestions on how to stop the macro engine from trying to resolve the macro references?&lt;/P&gt;&lt;P&gt;Thank you&lt;/P&gt;&lt;P&gt;SAS 9.4&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 14 Oct 2020 18:57:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-suppress-macro-resolution/m-p/691636#M210530</guid>
      <dc:creator>mikegia5</dc:creator>
      <dc:date>2020-10-14T18:57:56Z</dc:date>
    </item>
    <item>
      <title>Re: How to suppress macro resolution</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-suppress-macro-resolution/m-p/691642#M210537</link>
      <description>Use single quotes, if possible, or switch to FIND() or regular expressions are other options.</description>
      <pubDate>Wed, 14 Oct 2020 19:12:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-suppress-macro-resolution/m-p/691642#M210537</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2020-10-14T19:12:49Z</dc:date>
    </item>
    <item>
      <title>Re: How to suppress macro resolution</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-suppress-macro-resolution/m-p/691646#M210540</link>
      <description>&lt;P&gt;Thank you Reeza,&lt;/P&gt;&lt;P&gt;I'm not sure how to apply your suggestions?&amp;nbsp; I changed the double quotes to single quotes but that didn't work.&amp;nbsp; Are you suggesting I don't use the SQL LIKE predicate and instead use a FIND or REGEX to search through the database? While that might work, the database I'm reading is in a relational database (DB2) that contains 10 billion rows and anything that isn't supported in the database will result in the data being passed back to SAS, so I really want to use native relational database predicates as much as possible.&lt;/P&gt;</description>
      <pubDate>Wed, 14 Oct 2020 19:30:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-suppress-macro-resolution/m-p/691646#M210540</guid>
      <dc:creator>mikegia5</dc:creator>
      <dc:date>2020-10-14T19:30:52Z</dc:date>
    </item>
    <item>
      <title>ARe: How to suppress macro resolution</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-suppress-macro-resolution/m-p/691659#M210546</link>
      <description>&lt;P&gt;Also, when debugging macros, use the command&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;options mprint;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;and then re-run the code, and show us the log from that run.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 14 Oct 2020 20:10:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-suppress-macro-resolution/m-p/691659#M210546</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2020-10-14T20:10:56Z</dc:date>
    </item>
    <item>
      <title>Re: How to suppress macro resolution</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-suppress-macro-resolution/m-p/691665#M210548</link>
      <description>&lt;P&gt;I think you can use NRSTR for that but you need to escape the % sign in the expression %%&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;183  options symbolgen=1;
184  data c;
185     input cics $;
186     put _all_;
187     cards;

cics=PthiTZ _ERROR_=0 _N_=1
cics=XthiT1 _ERROR_=0 _N_=2
cics=P--T1 _ERROR_=0 _N_=3
NOTE: The data set WORK.C has 3 observations and 1 variables.
191  ;;;;
192
193  %let a = %nrstr(cics like "P%%TZ" or cics like "P%%T1");
194
195  data _null_;
196     set c;
SYMBOLGEN:  Macro variable A resolves to cics like "P%TZ" or cics like "P%T1"
SYMBOLGEN:  Some characters in the above value which were subject to macro quoting have been unquoted for
            printing.
197     where &amp;amp;a;
198     put _all_;
199     run;

cics=PthiTZ _ERROR_=0 _N_=1
cics=P--T1 _ERROR_=0 _N_=2
NOTE: There were 2 observations read from the data set WORK.C.
      WHERE cics like 'P%TZ' or cics like 'P%T1';&lt;/PRE&gt;</description>
      <pubDate>Wed, 14 Oct 2020 20:30:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-suppress-macro-resolution/m-p/691665#M210548</guid>
      <dc:creator>data_null__</dc:creator>
      <dc:date>2020-10-14T20:30:24Z</dc:date>
    </item>
    <item>
      <title>Re: ARe: How to suppress macro resolution</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-suppress-macro-resolution/m-p/691667#M210550</link>
      <description>&lt;P&gt;Try using the "q" versions of sysfunc and scan.&amp;nbsp; They work the same as the normal functions but macro quote the results.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%macro test(acics);
  %if %length(&amp;amp;acics) &amp;gt; 1 %then
  %do;
  and (
  %let acics=%qsysfunc(translate(&amp;amp;acics,%NRSTR(%_),%NRSTR(*+)));
  %do i=1 %to %sysfunc(countw(%superq(acics),' '));
  %if &amp;amp;i &amp;gt; 1 %then or;
  CICS like "%qscan(%superq(acics),&amp;amp;i,' ')"
  %end;) %end;
%mend;
options mprint;
%test(P*TZ P*T1 );&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 14 Oct 2020 20:33:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-suppress-macro-resolution/m-p/691667#M210550</guid>
      <dc:creator>CurtisMackWSIPP</dc:creator>
      <dc:date>2020-10-14T20:33:16Z</dc:date>
    </item>
    <item>
      <title>Re: How to suppress macro resolution</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-suppress-macro-resolution/m-p/691672#M210554</link>
      <description>Without seeing more of the code I can't answer. I don't know how you're passing parameters or using the values. DB2 does support regex from what I can see.&lt;BR /&gt;&lt;BR /&gt;&lt;A href="https://www.ibm.com/support/producthub/db2/docs/content/SSEPGG_11.5.0/com.ibm.db2.luw.sql.ref.doc/doc/r0061494.html?pos=2" target="_blank"&gt;https://www.ibm.com/support/producthub/db2/docs/content/SSEPGG_11.5.0/com.ibm.db2.luw.sql.ref.doc/doc/r0061494.html?pos=2&lt;/A&gt;</description>
      <pubDate>Wed, 14 Oct 2020 20:47:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-suppress-macro-resolution/m-p/691672#M210554</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2020-10-14T20:47:05Z</dc:date>
    </item>
    <item>
      <title>Re: How to suppress macro resolution</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-suppress-macro-resolution/m-p/691686#M210558</link>
      <description>&lt;P&gt;So it looks like you've got a macro variable/parameter containing a list of where clause predicate suffixes, i.e. TZ T1 etc.&lt;/P&gt;
&lt;P&gt;And you're trying to build a where clause, looping over those tokens:&lt;/P&gt;
&lt;P&gt;cics like 'P%TZ' or cics like 'P%T1'&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;My macro library is located at&amp;nbsp;&lt;A href="https://github.com/scottbass/SAS/tree/master/Macro" target="_blank" rel="noopener"&gt;https://github.com/scottbass/SAS/tree/master/Macro&lt;/A&gt;.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You want %loop, %squote, and %parmv.&amp;nbsp; If you don't want to use them, then use the code as a guide for your own macro.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I would pull the AND operator out of the macro, so the macro contains just the loop construct, with the calling code containing the rest of the where clause syntax.&amp;nbsp; But that is just coding style.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Finally, the simplest approach is just to temporarily set &lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;option nomerror&lt;/STRONG&gt;&lt;/FONT&gt; to suppress warnings of unresolved macro references.&amp;nbsp; Of course, don't create %TZ or %T1 macros &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The code then becomes:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;options mprint nomerror;

%macro code;
%if (&amp;amp;__iter__ gt 1) %then or;
cics like %squote(P%&amp;amp;word)
%mend;

%let asics=TZ T1;

data foo;
   set sashelp.class (rename=(name=cics));
   where 1=1 and (%loop(&amp;amp;asics));
run;

* Alternative approach ;
%let where=1=1 and (%loop(&amp;amp;asics));

data foo;
   set sashelp.class (rename=(name=cics));
   where &amp;amp;where;
run;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;and the log:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;29         %macro code;
30         %if (&amp;amp;__iter__ gt 1) %then or;
31         cics like %squote(P%&amp;amp;word)
32         %mend;
33         
34         %let asics=TZ T1;
35         
36         data foo;
37            set sashelp.class (rename=(name=cics));
38            where 1=1 and (%loop(&amp;amp;asics));
MPRINT(CODE):   cics like
MPRINT(SQUOTE):   'P%TZ'
MPRINT(CODE):   or cics like
MPRINT(SQUOTE):   'P%T1'
39         run;

NOTE: There were 0 observations read from the data set SASHELP.CLASS.
      WHERE (1=1) and (cics like 'P%TZ' or cics like 'P%T1');
2 The SAS System                                                                        08:18 Thursday, October 15, 2020

NOTE: The data set WORK.FOO has 0 observations and 5 variables.
NOTE: DATA statement used (Total process time):
      real time           0.01 seconds
      user cpu time       0.00 seconds
      system cpu time     0.00 seconds
      memory              269.75k
      OS Memory           13092.00k
      Timestamp           15/10/2020 08:42:10 AM
      

40         
41         * Alternative approach ;
42         %let where=1=1 and (%loop(&amp;amp;asics));
43         
44         data foo;
45            set sashelp.class (rename=(name=cics));
46            where &amp;amp;where;
47         run;

NOTE: There were 0 observations read from the data set SASHELP.CLASS.
      WHERE (1=1) and (cics like 'P%TZ' or cics like 'P%T1');
NOTE: The data set WORK.FOO has 0 observations and 5 variables.
NOTE: DATA statement used (Total process time):
      real time           0.00 seconds
      user cpu time       0.00 seconds
      system cpu time     0.00 seconds
      memory              269.62k
      OS Memory           13092.00k
      Timestamp           15/10/2020 08:42:10 AM&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Of course, this returns nothing using sashelp.class, but should be syntactically correct for your scenario.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If this does not meet your needs, please give details why so we can help further.&lt;/P&gt;</description>
      <pubDate>Wed, 14 Oct 2020 21:48:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-suppress-macro-resolution/m-p/691686#M210558</guid>
      <dc:creator>ScottBass</dc:creator>
      <dc:date>2020-10-14T21:48:06Z</dc:date>
    </item>
    <item>
      <title>Re: How to suppress macro resolution</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-suppress-macro-resolution/m-p/691692#M210559</link>
      <description>&lt;P&gt;Ok, thanks!&amp;nbsp;&amp;nbsp;The single quotes helped when combined with another solution &lt;span class="lia-unicode-emoji" title=":beaming_face_with_smiling_eyes:"&gt;😁&lt;/span&gt;&lt;/P&gt;&lt;P&gt;cics&amp;nbsp;like %str(%')%qscan(%superq(acics),&amp;amp;i,' ')%str(%')&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 14 Oct 2020 22:06:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-suppress-macro-resolution/m-p/691692#M210559</guid>
      <dc:creator>mikegia5</dc:creator>
      <dc:date>2020-10-14T22:06:54Z</dc:date>
    </item>
    <item>
      <title>Re: ARe: How to suppress macro resolution</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-suppress-macro-resolution/m-p/691693#M210560</link>
      <description>&lt;P&gt;Thanks - I'm already using mprint but this is a large macro (about 400 lines) and the resulting MPRINT is long too, so I just snipped the relevant part.&lt;/P&gt;</description>
      <pubDate>Wed, 14 Oct 2020 22:08:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-suppress-macro-resolution/m-p/691693#M210560</guid>
      <dc:creator>mikegia5</dc:creator>
      <dc:date>2020-10-14T22:08:39Z</dc:date>
    </item>
    <item>
      <title>Re: ARe: How to suppress macro resolution</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-suppress-macro-resolution/m-p/691694#M210561</link>
      <description>&lt;P&gt;Perfect - thanks for understanding what I was trying to do and coming up with a solution!&amp;nbsp; I changed to qsysfunc and qscan and that solved the warnings coming out of the macro, but what I didn't say is that this is dynamic code and I run the macro via the execute function so when it came time to run the code, I still had some warnings using double quotes (i.e., LIKE "P%TZ").&amp;nbsp; So I added an escaped single quote and now it runs without a problem!&amp;nbsp; Thanks again.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%if %length(&amp;amp;acics) &amp;gt; 1 %then                                   
%do;                                                            
and (                                                           
%let acics=%qsysfunc(translate(&amp;amp;acics,%NRSTR(%_),%NRSTR(*+)));  
%do i=1 %to %sysfunc(countw(%superq(acics),' '));               
  %if &amp;amp;i &amp;gt; 1 %then or;                                          
  region_id like %str(%')%qscan(%superq(acics),&amp;amp;i,' ')%str(%')  
%end;) %end;                                                    &lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 14 Oct 2020 22:13:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-suppress-macro-resolution/m-p/691694#M210561</guid>
      <dc:creator>mikegia5</dc:creator>
      <dc:date>2020-10-14T22:13:24Z</dc:date>
    </item>
    <item>
      <title>Re: How to suppress macro resolution</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-suppress-macro-resolution/m-p/691695#M210562</link>
      <description>&lt;P&gt;I don't have any control over the input data, so I would need to scan for the % sign and double up on it.&amp;nbsp; I found another solution above that worked.&amp;nbsp; Thanks for your input!&lt;/P&gt;</description>
      <pubDate>Wed, 14 Oct 2020 22:15:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-suppress-macro-resolution/m-p/691695#M210562</guid>
      <dc:creator>mikegia5</dc:creator>
      <dc:date>2020-10-14T22:15:51Z</dc:date>
    </item>
    <item>
      <title>Re: How to suppress macro resolution</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-suppress-macro-resolution/m-p/691696#M210563</link>
      <description>&lt;P&gt;&lt;STRIKE&gt;&lt;/STRIKE&gt;Thank you Scott.&amp;nbsp; I bookmarked your GitHub link and will definitely be taking a look.&amp;nbsp; For now I've solved it using the Qscan, qsysfunc, and single quoting techniques above.&amp;nbsp; If they didn't work I would have worked my way down to your solution next.&amp;nbsp; I didn't want to use nomerror since this is just data and someone will run a combination&amp;nbsp;resulting in finding a real macro name!&lt;/P&gt;</description>
      <pubDate>Wed, 14 Oct 2020 22:22:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-suppress-macro-resolution/m-p/691696#M210563</guid>
      <dc:creator>mikegia5</dc:creator>
      <dc:date>2020-10-14T22:22:58Z</dc:date>
    </item>
    <item>
      <title>Re: How to suppress macro resolution</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-suppress-macro-resolution/m-p/691697#M210564</link>
      <description>&lt;P&gt;Note that to the macro process quotes are just like other characters. So using &lt;FONT face="courier new,courier"&gt;' '&lt;/FONT&gt; as the delimiters in your %SCAN() call means that both single quotes and spaces are delimiters.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But quotes do have an impact: macro triggers (&amp;amp; and %) are ignored inside of single quotes.&amp;nbsp; You can use that fact to simplify the translation operations a little.&lt;/P&gt;
&lt;P&gt;Let's make a macro that does what it looks like you are trying to do, generate a LIKE ANY type syntax.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%macro likeany(var,terms);
%local i sep term;
(
%do i=1 %to %sysfunc(countw(%superq(terms),%str( )));
  %let term=%str(%')%qscan(%superq(terms),&amp;amp;i,%str( ))%str(%');
  &amp;amp;sep &amp;amp;var like %sysfunc(translate(&amp;amp;term,'%_','*+'))
  %let sep=or;
%end;
)
%mend likeany;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Now let's test it :&lt;/P&gt;
&lt;PRE&gt;123   %put %likeany(cics,P*TZ P*T1);
( cics like 'P%TZ'   or cics like 'P%T1' )&lt;/PRE&gt;</description>
      <pubDate>Thu, 15 Oct 2020 15:35:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-suppress-macro-resolution/m-p/691697#M210564</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2020-10-15T15:35:50Z</dc:date>
    </item>
    <item>
      <title>Re: How to suppress macro resolution</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-suppress-macro-resolution/m-p/691698#M210565</link>
      <description>&lt;P&gt;Thanks Mike.&amp;nbsp; I also realized after posting that my code doesn't account for a null &amp;amp;asics parameter, and would generate a syntactically incorrect where clause (my coding style changes).&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Since you have a solution, I don't consider it worthwhile to modify my post.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Glad you got it working.&lt;/P&gt;</description>
      <pubDate>Wed, 14 Oct 2020 22:29:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-suppress-macro-resolution/m-p/691698#M210565</guid>
      <dc:creator>ScottBass</dc:creator>
      <dc:date>2020-10-14T22:29:46Z</dc:date>
    </item>
  </channel>
</rss>

