<?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 avoid the WARNING: Apparent invocation of macro  xx not resolved in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-to-avoid-the-WARNING-Apparent-invocation-of-macro-xx-not/m-p/896864#M354394</link>
    <description>&lt;P&gt;Although the single quotes around the LIKE string prevents the warning, the code does not produce the desired results.&lt;/P&gt;
&lt;P&gt;NOTE: The data set WORK.ER has 0 observations and 1 variables.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Desired SAS Log:&lt;/P&gt;
&lt;P&gt;NOTE: The data set WORK.ER has 21 observations and 1 variables.&lt;/P&gt;
&lt;P&gt;NOTE: There were 12 observations read from the data set WORK.SASHELP_DATA&lt;/P&gt;
&lt;PRE&gt;
data sashelp_data;
 set sashelp.vtable (where = (libname="SASHELP")) ;
keep memname;
run;

%macro mymacro (df=, ch=);
data &amp;amp;df;
 set sashelp_data;
  where upcase(memname) like '%_&amp;amp;ch';
 run;
%mend mymacro;
%mymacro(df=er,ch=T)
%mymacro(df=ip,ch=N)&lt;/PRE&gt;
&lt;P&gt;What am I doing wrong here?&lt;/P&gt;</description>
    <pubDate>Tue, 03 Oct 2023 07:19:21 GMT</pubDate>
    <dc:creator>pkm_edu</dc:creator>
    <dc:date>2023-10-03T07:19:21Z</dc:date>
    <item>
      <title>How to avoid the WARNING: Apparent invocation of macro  xx not resolved</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-avoid-the-WARNING-Apparent-invocation-of-macro-xx-not/m-p/896858#M354390</link>
      <description>&lt;PRE&gt;The following code provides me the desired results but the SAS Log shows the &lt;BR /&gt;following warnings.&lt;BR /&gt;WARNING: Apparent invocation of macro _T not resolved.&lt;BR /&gt;WARNING: Apparent invocation of macro _N not resolved.&lt;BR /&gt;
data sashelp_data;
 set sashelp.vtable (where = (libname="SASHELP")) ;
keep memname;
run;

%macro mymacro (df=, ch=);
data &amp;amp;df;
 set sashelp_data;
 where upcase(memname) like "%_&amp;amp;ch";
 run;
%mend mymacro;
%mymacro(df=er,ch=T)
%mymacro(df=ip,ch=N)&lt;/PRE&gt;
&lt;P&gt;Code explanation of "%_&amp;amp;ch" in the like condition: The&amp;nbsp; wild character % is used as a substitute for zero or more characters while the&amp;nbsp; '_' is used as a single character. &amp;amp;ch is a macro variable reference whose values are T and N in two macro calls.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Question: What would I do to avoid the above warnings?&lt;/P&gt;
&lt;P&gt;I would appreciate it if someone could help me with a resolution of the issue?&lt;/P&gt;</description>
      <pubDate>Tue, 03 Oct 2023 06:38:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-avoid-the-WARNING-Apparent-invocation-of-macro-xx-not/m-p/896858#M354390</guid>
      <dc:creator>pkm_edu</dc:creator>
      <dc:date>2023-10-03T06:38:40Z</dc:date>
    </item>
    <item>
      <title>Re: How to avoid the WARNING: Apparent invocation of macro  xx not resolved</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-avoid-the-WARNING-Apparent-invocation-of-macro-xx-not/m-p/896859#M354391</link>
      <description>&lt;P&gt;Use single quotes around the LIKE string; this will prevent the macro processor from trying to resolve the % trigger.&lt;/P&gt;</description>
      <pubDate>Tue, 03 Oct 2023 06:46:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-avoid-the-WARNING-Apparent-invocation-of-macro-xx-not/m-p/896859#M354391</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2023-10-03T06:46:43Z</dc:date>
    </item>
    <item>
      <title>Re: How to avoid the WARNING: Apparent invocation of macro  xx not resolved</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-avoid-the-WARNING-Apparent-invocation-of-macro-xx-not/m-p/896861#M354393</link>
      <description>&lt;P&gt;Thanks for the solution.&lt;/P&gt;
&lt;P&gt;Alternatively, why does the following not work?&lt;/P&gt;
&lt;P&gt;where upcase(memname) like %NRSTR("%_&amp;amp;ch");&lt;/P&gt;</description>
      <pubDate>Tue, 03 Oct 2023 06:54:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-avoid-the-WARNING-Apparent-invocation-of-macro-xx-not/m-p/896861#M354393</guid>
      <dc:creator>pkm_edu</dc:creator>
      <dc:date>2023-10-03T06:54:44Z</dc:date>
    </item>
    <item>
      <title>Re: How to avoid the WARNING: Apparent invocation of macro  xx not resolved</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-avoid-the-WARNING-Apparent-invocation-of-macro-xx-not/m-p/896864#M354394</link>
      <description>&lt;P&gt;Although the single quotes around the LIKE string prevents the warning, the code does not produce the desired results.&lt;/P&gt;
&lt;P&gt;NOTE: The data set WORK.ER has 0 observations and 1 variables.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Desired SAS Log:&lt;/P&gt;
&lt;P&gt;NOTE: The data set WORK.ER has 21 observations and 1 variables.&lt;/P&gt;
&lt;P&gt;NOTE: There were 12 observations read from the data set WORK.SASHELP_DATA&lt;/P&gt;
&lt;PRE&gt;
data sashelp_data;
 set sashelp.vtable (where = (libname="SASHELP")) ;
keep memname;
run;

%macro mymacro (df=, ch=);
data &amp;amp;df;
 set sashelp_data;
  where upcase(memname) like '%_&amp;amp;ch';
 run;
%mend mymacro;
%mymacro(df=er,ch=T)
%mymacro(df=ip,ch=N)&lt;/PRE&gt;
&lt;P&gt;What am I doing wrong here?&lt;/P&gt;</description>
      <pubDate>Tue, 03 Oct 2023 07:19:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-avoid-the-WARNING-Apparent-invocation-of-macro-xx-not/m-p/896864#M354394</guid>
      <dc:creator>pkm_edu</dc:creator>
      <dc:date>2023-10-03T07:19:21Z</dc:date>
    </item>
    <item>
      <title>Re: How to avoid the WARNING: Apparent invocation of macro  xx not resolved</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-avoid-the-WARNING-Apparent-invocation-of-macro-xx-not/m-p/896903#M354415</link>
      <description>&lt;A href="https://communities.sas.com/t5/SAS-Programming/warning-in-macro/m-p/895602#M353859" target="_blank"&gt;https://communities.sas.com/t5/SAS-Programming/warning-in-macro/m-p/895602#M353859&lt;/A&gt;</description>
      <pubDate>Tue, 03 Oct 2023 10:50:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-avoid-the-WARNING-Apparent-invocation-of-macro-xx-not/m-p/896903#M354415</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2023-10-03T10:50:58Z</dc:date>
    </item>
    <item>
      <title>Re: How to avoid the WARNING: Apparent invocation of macro  xx not resolved</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-avoid-the-WARNING-Apparent-invocation-of-macro-xx-not/m-p/896904#M354416</link>
      <description>&lt;P&gt;You can use a concatenation to build the pattern string:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%macro mymacro (df=, ch=);
data &amp;amp;df;
set sashelp.vtable;
where libname = "SASHELP" and upcase(memname) like '%'!!"_&amp;amp;ch";
run;
%mend mymacro;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 03 Oct 2023 10:53:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-avoid-the-WARNING-Apparent-invocation-of-macro-xx-not/m-p/896904#M354416</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2023-10-03T10:53:04Z</dc:date>
    </item>
    <item>
      <title>Re: How to avoid the WARNING: Apparent invocation of macro  xx not resolved</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-avoid-the-WARNING-Apparent-invocation-of-macro-xx-not/m-p/896921#M354428</link>
      <description>&lt;P&gt;Thanks for the detailed info.&lt;/P&gt;</description>
      <pubDate>Tue, 03 Oct 2023 12:05:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-avoid-the-WARNING-Apparent-invocation-of-macro-xx-not/m-p/896921#M354428</guid>
      <dc:creator>pkm_edu</dc:creator>
      <dc:date>2023-10-03T12:05:32Z</dc:date>
    </item>
    <item>
      <title>Re: How to avoid the WARNING: Apparent invocation of macro  xx not resolved</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-avoid-the-WARNING-Apparent-invocation-of-macro-xx-not/m-p/896922#M354429</link>
      <description>&lt;P&gt;The code has worked. Concatenating&amp;nbsp; the wild character (%) in single quotes with any single character (_) and the macro variable reference (_&amp;amp;ch) in double quotes makes sense to me.&amp;nbsp; Thanks.&lt;/P&gt;</description>
      <pubDate>Tue, 03 Oct 2023 12:18:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-avoid-the-WARNING-Apparent-invocation-of-macro-xx-not/m-p/896922#M354429</guid>
      <dc:creator>pkm_edu</dc:creator>
      <dc:date>2023-10-03T12:18:32Z</dc:date>
    </item>
  </channel>
</rss>

