<?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: WARNING:Apparent invocation of macro not resolved. in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/WARNING-Apparent-invocation-of-macro-not-resolved/m-p/555761#M154698</link>
    <description>&lt;P&gt;This worked!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Could you please explain why did I have to use the include with the macro invocation? I've never seen anyone do that before?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 02 May 2019 20:52:53 GMT</pubDate>
    <dc:creator>AJ_Brien</dc:creator>
    <dc:date>2019-05-02T20:52:53Z</dc:date>
    <item>
      <title>WARNING:Apparent invocation of macro not resolved.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/WARNING-Apparent-invocation-of-macro-not-resolved/m-p/555724#M154677</link>
      <description>&lt;P&gt;Hello,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm trying to invoke a macro from my code but I keep getting this error:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;WARNING:&lt;/STRONG&gt;&lt;STRONG&gt;Apparent invocation of macro TEST not resolved.&lt;/STRONG&gt;&lt;STRONG&gt;&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;ERROR 180-322: Statement is not valid or it is used out of proper order.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is the code that I'm calling the macro from:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;Options                                                                                                                           
   Mautosource                                                                                                                    
   Sasautos = ('unix link where the test.sas file is located')                                                                                                 
   source2                                                                                                                        
   nocenter mlogic symbolgen                                                                                               
   ; 

%test(table.acct,acct);&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;when I copy paste the entire macro in the code, it runs fine. which confirms there is nothing wrong with the macro. Below is the macro definition in the file test.sas:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%macro test(table,var);

proc sql noprint;
        CONNECT TO teradata (user= "%sysget(user)" password = "&amp;amp;pass" tdpid="rchtera" mode=teradata);
		create table abc as select * from connection to teradata
	( select top 2 &amp;amp;var. from &amp;amp;table.);
	disconnect from teradata;
	quit;

%mend;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I even tried using %include, but that hasn't helped either. In any case I would prefer invoking without using %include.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Appreciate any help!&lt;/P&gt;</description>
      <pubDate>Thu, 02 May 2019 18:53:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/WARNING-Apparent-invocation-of-macro-not-resolved/m-p/555724#M154677</guid>
      <dc:creator>AJ_Brien</dc:creator>
      <dc:date>2019-05-02T18:53:32Z</dc:date>
    </item>
    <item>
      <title>Re: WARNING:Apparent invocation of macro not resolved.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/WARNING-Apparent-invocation-of-macro-not-resolved/m-p/555739#M154682</link>
      <description>&lt;P&gt;What happens when you try to %include the file?&amp;nbsp; Does it not see test.sas?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Remember that on unix your file paths/names are case sensitive.&amp;nbsp; Also double check that your link is working.&amp;nbsp; Yet another possibility is that the account used to run the SAS job does not have read access to test.sas.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also, within a SAS session SAS will only look for an autocall macro definition once, by default.&amp;nbsp; So once you see that message, it will not look again for the definition.&amp;nbsp; When debugging, it's sometimes helpful to change that by setting the system option MRECALL.&lt;/P&gt;</description>
      <pubDate>Thu, 02 May 2019 19:41:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/WARNING-Apparent-invocation-of-macro-not-resolved/m-p/555739#M154682</guid>
      <dc:creator>Quentin</dc:creator>
      <dc:date>2019-05-02T19:41:44Z</dc:date>
    </item>
    <item>
      <title>Re: WARNING:Apparent invocation of macro not resolved.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/WARNING-Apparent-invocation-of-macro-not-resolved/m-p/555741#M154683</link>
      <description>&lt;P&gt;I checked the link, no issues there with the access. There is no inconsistency in the name of the file either, the case and spelling match.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried include like this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;filename job "unix link where test.sas is located";&lt;BR /&gt;%include job(test);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is what I get in logs:&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;WARNING: Physical file does not exist, /unix link/test.sas.&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;ERROR: Cannot %INCLUDE member test in the aggregate JOB.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 02 May 2019 19:49:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/WARNING-Apparent-invocation-of-macro-not-resolved/m-p/555741#M154683</guid>
      <dc:creator>AJ_Brien</dc:creator>
      <dc:date>2019-05-02T19:49:30Z</dc:date>
    </item>
    <item>
      <title>Re: WARNING:Apparent invocation of macro not resolved.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/WARNING-Apparent-invocation-of-macro-not-resolved/m-p/555749#M154688</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/265086"&gt;@AJ_Brien&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;I checked the link, no issues there with the access. There is no inconsistency in the name of the file either, the case and spelling match.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I tried include like this:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;filename job "unix link where test.sas is located";&lt;BR /&gt;%include job(test);&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This is what I get in logs:&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;WARNING: Physical file does not exist, /unix link/test.sas.&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;ERROR: Cannot %INCLUDE member test in the aggregate JOB.&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;What happens when you don't use a filename reference at all? If it can't find that path/program then it won't run.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%include ' path to .sas file here';&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 02 May 2019 20:07:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/WARNING-Apparent-invocation-of-macro-not-resolved/m-p/555749#M154688</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2019-05-02T20:07:48Z</dc:date>
    </item>
    <item>
      <title>Re: WARNING:Apparent invocation of macro not resolved.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/WARNING-Apparent-invocation-of-macro-not-resolved/m-p/555752#M154691</link>
      <description>&lt;P&gt;I get this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;ERROR: Invalid file, 'path to .sas file'.&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;ERROR: Cannot open %INCLUDE file 'path to .sas file'.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But I queried a dataset that exists in that same link and was able to see that without any problem. So I definitely do not have any access issues and that path is definitely correct.&lt;/P&gt;</description>
      <pubDate>Thu, 02 May 2019 20:15:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/WARNING-Apparent-invocation-of-macro-not-resolved/m-p/555752#M154691</guid>
      <dc:creator>AJ_Brien</dc:creator>
      <dc:date>2019-05-02T20:15:54Z</dc:date>
    </item>
    <item>
      <title>Re: WARNING:Apparent invocation of macro not resolved.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/WARNING-Apparent-invocation-of-macro-not-resolved/m-p/555755#M154693</link>
      <description>Do you have the file name correct? The extension? The file doesn't exist for some reason? It's all lower case in both places like someone else mentioned?</description>
      <pubDate>Thu, 02 May 2019 20:32:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/WARNING-Apparent-invocation-of-macro-not-resolved/m-p/555755#M154693</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2019-05-02T20:32:38Z</dc:date>
    </item>
    <item>
      <title>Re: WARNING:Apparent invocation of macro not resolved.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/WARNING-Apparent-invocation-of-macro-not-resolved/m-p/555757#M154695</link>
      <description>&lt;P&gt;When you add a path into the SASAUTOS option and then ask to run a macro named TEST it will look for a file name 'test.sas' in that location.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So what happens when you try:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%include 'unix link where the test.sas file is located/test.sas' ;
%test(table.acct,acct);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Unix can do strange things also.&amp;nbsp; Someone had an issue on this forum a little while ago because the actual name of the file ended in a space.&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 02 May 2019 20:44:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/WARNING-Apparent-invocation-of-macro-not-resolved/m-p/555757#M154695</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2019-05-02T20:44:50Z</dc:date>
    </item>
    <item>
      <title>Re: WARNING:Apparent invocation of macro not resolved.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/WARNING-Apparent-invocation-of-macro-not-resolved/m-p/555761#M154698</link>
      <description>&lt;P&gt;This worked!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Could you please explain why did I have to use the include with the macro invocation? I've never seen anyone do that before?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 02 May 2019 20:52:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/WARNING-Apparent-invocation-of-macro-not-resolved/m-p/555761#M154698</guid>
      <dc:creator>AJ_Brien</dc:creator>
      <dc:date>2019-05-02T20:52:53Z</dc:date>
    </item>
    <item>
      <title>Re: WARNING:Apparent invocation of macro not resolved.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/WARNING-Apparent-invocation-of-macro-not-resolved/m-p/555767#M154703</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/265086"&gt;@AJ_Brien&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;This worked!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Could you please explain why did I have to use the include with the macro invocation? I've never seen anyone do that before?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;When the %include is successful, assuming there is actual SAS code in the file, then that code is submitted for execution. In this case that likely means the macro was finally compiled.&lt;/P&gt;
&lt;P&gt;The log likely had a note to that affect.&lt;/P&gt;</description>
      <pubDate>Thu, 02 May 2019 21:05:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/WARNING-Apparent-invocation-of-macro-not-resolved/m-p/555767#M154703</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2019-05-02T21:05:26Z</dc:date>
    </item>
    <item>
      <title>Re: WARNING:Apparent invocation of macro not resolved.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/WARNING-Apparent-invocation-of-macro-not-resolved/m-p/555773#M154707</link>
      <description>&lt;P&gt;Then the issue is the MRECALL option as previously mentioned.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Perhaps your autoexec or some earlier code in the same SAS session already used that macro name and so SAS thinks it shouldn't have to look for the source again.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The MRECALL option is what tells it to try again.&lt;/P&gt;</description>
      <pubDate>Thu, 02 May 2019 21:12:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/WARNING-Apparent-invocation-of-macro-not-resolved/m-p/555773#M154707</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2019-05-02T21:12:32Z</dc:date>
    </item>
    <item>
      <title>Re: WARNING:Apparent invocation of macro not resolved.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/WARNING-Apparent-invocation-of-macro-not-resolved/m-p/555774#M154708</link>
      <description>&lt;P&gt;And the name of the file you included was literally test.sas and not something with one or more uppercase letters?&amp;nbsp; Like TEST.SAS or Test.SAS?&lt;/P&gt;</description>
      <pubDate>Thu, 02 May 2019 21:13:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/WARNING-Apparent-invocation-of-macro-not-resolved/m-p/555774#M154708</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2019-05-02T21:13:50Z</dc:date>
    </item>
  </channel>
</rss>

