<?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 Not Resolving with MAUTOSOURCE / MRECALL / SASAUTOS Defined in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/SAS-Macro-Not-Resolving-with-MAUTOSOURCE-MRECALL-SASAUTOS/m-p/754985#M238196</link>
    <description>&lt;P&gt;Are you storing your macro definition as source files to be found by the SASAUTOS path?&lt;/P&gt;
&lt;P&gt;Or are you storing them in pre-compiled catalogs to be referenced from there?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Personally I never use MSTORED as I prefer to be able to look at the source code files and to be able to update individual files with operating system tools (like version control software).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 19 Jul 2021 13:30:29 GMT</pubDate>
    <dc:creator>Tom</dc:creator>
    <dc:date>2021-07-19T13:30:29Z</dc:date>
    <item>
      <title>SAS Macro Not Resolving with MAUTOSOURCE / MRECALL / SASAUTOS Defined</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-Macro-Not-Resolving-with-MAUTOSOURCE-MRECALL-SASAUTOS/m-p/754936#M238172</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am trying to use the MAUTOSOURCE system option, paired with the SASAUTOS statement to compile macros, to allow them to be auto-called later. Below is my code:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;
%* Method 1;
options mrecall mautosource sasautos=(%sysget(sasautos) "C:\mymacros");


%* Method 2;
filename mymac "C:\mymacros";
options mrecall mautosource sasautos=(%sysget(sasautos) mymac);
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Both methods above do not seem to work yet the logs are clean, when I try to resolve any macro located in the "C:/MyMacros" the warning "WARNING: Apparent invocation of macro xxx not resolved" appears. I understand this means the macro has not been autocompiled so SAS cannot see it yet.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Worth nothing, yes I can confirm the macro is named the same as the macro program itself and is located in the path above.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Any help please? I did get it working, but closed SAS and reopened to double check it worked, but it did not work. I think I am missing something obvious.&lt;/P&gt;</description>
      <pubDate>Mon, 19 Jul 2021 09:00:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-Macro-Not-Resolving-with-MAUTOSOURCE-MRECALL-SASAUTOS/m-p/754936#M238172</guid>
      <dc:creator>craig159753</dc:creator>
      <dc:date>2021-07-19T09:00:13Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Macro Not Resolving with MAUTOSOURCE / MRECALL / SASAUTOS Defined</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-Macro-Not-Resolving-with-MAUTOSOURCE-MRECALL-SASAUTOS/m-p/754939#M238174</link>
      <description>&lt;P&gt;You need to use either the INSERT= to place a new value at the beginning of a list or Append= for at the end of the list. &lt;/P&gt;
&lt;PRE&gt;%* Method 1;
options mrecall mautosource Append=(sasautos  "C:\mymacros");&lt;/PRE&gt;
&lt;P&gt;The general syntax is Append= or insert=(&amp;lt;list name&amp;gt; newvalue); List name is the option you want to work with. You do not need to recall other values, just the list name. If you ONLY want specific values then you use the &amp;lt;listname&amp;gt;=( &amp;lt;explicit values&amp;gt;)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Note: if this Append or Insert code is resubmitted you keep adding the same folder to the list. So generally try to execute the Append/insert only once as when you go to remove it you may have to remove it multiple times.&lt;/P&gt;</description>
      <pubDate>Mon, 19 Jul 2021 09:52:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-Macro-Not-Resolving-with-MAUTOSOURCE-MRECALL-SASAUTOS/m-p/754939#M238174</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2021-07-19T09:52:55Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Macro Not Resolving with MAUTOSOURCE / MRECALL / SASAUTOS Defined</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-Macro-Not-Resolving-with-MAUTOSOURCE-MRECALL-SASAUTOS/m-p/754949#M238178</link>
      <description>&lt;P&gt;Turns out I had old code in the program calling the macro, which was resetting the settings after defining them, as displayed in my example. Removed the code and suggested code work. Rookie error.&lt;/P&gt;</description>
      <pubDate>Mon, 19 Jul 2021 10:17:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-Macro-Not-Resolving-with-MAUTOSOURCE-MRECALL-SASAUTOS/m-p/754949#M238178</guid>
      <dc:creator>craig159753</dc:creator>
      <dc:date>2021-07-19T10:17:04Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Macro Not Resolving with MAUTOSOURCE / MRECALL / SASAUTOS Defined</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-Macro-Not-Resolving-with-MAUTOSOURCE-MRECALL-SASAUTOS/m-p/754966#M238185</link>
      <description>options mrecall mautosource  mstored  sasmstore= "C:\mymacros" ;</description>
      <pubDate>Mon, 19 Jul 2021 12:04:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-Macro-Not-Resolving-with-MAUTOSOURCE-MRECALL-SASAUTOS/m-p/754966#M238185</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2021-07-19T12:04:45Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Macro Not Resolving with MAUTOSOURCE / MRECALL / SASAUTOS Defined</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-Macro-Not-Resolving-with-MAUTOSOURCE-MRECALL-SASAUTOS/m-p/754980#M238192</link>
      <description>&lt;P&gt;Hi Ksharp,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I actually already use the MSTORED MACROSTORE options&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;libname mylib1 "C:\mymacros\Set1";

libname mylib2 "C:\mymacros\Set2";

libname mylibs (mylib1 mylib2);

libname mylib1 clear;

libname mylib2 clear;



options mstored sasmstore=mylibs;


options mrecall mautosource&amp;nbsp;set = sasautos("!sasroot\core\sasmacro"&amp;nbsp;"C:\mymacros");&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Oddly now it does not seem to be working again after a reboot, bit confused now.&lt;/P&gt;</description>
      <pubDate>Mon, 19 Jul 2021 13:25:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-Macro-Not-Resolving-with-MAUTOSOURCE-MRECALL-SASAUTOS/m-p/754980#M238192</guid>
      <dc:creator>craig159753</dc:creator>
      <dc:date>2021-07-19T13:25:35Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Macro Not Resolving with MAUTOSOURCE / MRECALL / SASAUTOS Defined</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-Macro-Not-Resolving-with-MAUTOSOURCE-MRECALL-SASAUTOS/m-p/754985#M238196</link>
      <description>&lt;P&gt;Are you storing your macro definition as source files to be found by the SASAUTOS path?&lt;/P&gt;
&lt;P&gt;Or are you storing them in pre-compiled catalogs to be referenced from there?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Personally I never use MSTORED as I prefer to be able to look at the source code files and to be able to update individual files with operating system tools (like version control software).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 19 Jul 2021 13:30:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-Macro-Not-Resolving-with-MAUTOSOURCE-MRECALL-SASAUTOS/m-p/754985#M238196</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2021-07-19T13:30:29Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Macro Not Resolving with MAUTOSOURCE / MRECALL / SASAUTOS Defined</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-Macro-Not-Resolving-with-MAUTOSOURCE-MRECALL-SASAUTOS/m-p/754986#M238197</link>
      <description>&lt;P&gt;Hi Tom,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The answer is both, we have "standard" macros in macro catalogues. The source code is hidden from the user, this is why we use the MSTORED / MACROSTORE options.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The macros in question here are basic SAS programs which are macros, i.e., 1 macro per SAS program with the macro name being the same as the program name. These macros should be recalled by SAS using the MRECALL, SASAUTOS and MAUTOSOURCE options, but it is not playing ball.&lt;/P&gt;</description>
      <pubDate>Mon, 19 Jul 2021 13:43:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-Macro-Not-Resolving-with-MAUTOSOURCE-MRECALL-SASAUTOS/m-p/754986#M238197</guid>
      <dc:creator>craig159753</dc:creator>
      <dc:date>2021-07-19T13:43:42Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Macro Not Resolving with MAUTOSOURCE / MRECALL / SASAUTOS Defined</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-Macro-Not-Resolving-with-MAUTOSOURCE-MRECALL-SASAUTOS/m-p/754992#M238201</link>
      <description>&lt;P&gt;I have no idea if that type of hybrid system can work.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If it cannot then you might try something like this:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;On startup use PROC CATALOG to copy your stored compiled macros into the session's working macro catalog. (If using Display Manager that is WORK.SASMAC and if using EG or Studio it is WORK.SASMAC1).&lt;/P&gt;
&lt;P&gt;Then just use normal autocall for your other text based macros.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Note with this method there is no way to override your compiled macro definitions.&amp;nbsp; If you want to override the definition of one of those macros you would need to run the actual definition code.&amp;nbsp; Perhaps with %INCLUDE.&lt;/P&gt;</description>
      <pubDate>Mon, 19 Jul 2021 14:02:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-Macro-Not-Resolving-with-MAUTOSOURCE-MRECALL-SASAUTOS/m-p/754992#M238201</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2021-07-19T14:02:29Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Macro Not Resolving with MAUTOSOURCE / MRECALL / SASAUTOS Defined</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-Macro-Not-Resolving-with-MAUTOSOURCE-MRECALL-SASAUTOS/m-p/754995#M238202</link>
      <description>&lt;P&gt;Hi Tom,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Yeah this method does work, and for the definitions to take over a macro say in both a catalogue and in a SAS program the entry would need to be removed from the catalogue first, or by using the %INCLUDE statement like you suggested.&lt;/P&gt;
&lt;P&gt;After a reboot it is working now. Turns out the %sysget(sasautos) was causing an issue it returns with parenthesis which meaning the original SASAUTOS option was not correctly defined, once I resolved this I first had to reboot SAS. Then it worked.&lt;/P&gt;</description>
      <pubDate>Mon, 19 Jul 2021 14:13:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-Macro-Not-Resolving-with-MAUTOSOURCE-MRECALL-SASAUTOS/m-p/754995#M238202</guid>
      <dc:creator>craig159753</dc:creator>
      <dc:date>2021-07-19T14:13:19Z</dc:date>
    </item>
  </channel>
</rss>

