<?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 check which version of a macro function is use in SAS Enterprise Guide</title>
    <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-check-which-version-of-a-macro-function-is-use/m-p/977546#M46227</link>
    <description>&lt;P&gt;As long as you have not modified the SASAUTOS setting since the time that it was used to find the macro and compile it you could use this macro.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://github.com/sasutils/macros/blob/master/maclist.sas" target="_blank" rel="noopener"&gt;https://github.com/sasutils/macros/blob/master/maclist.sas&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For every compiled macro it will hunt through the paths listed in the SASAUTOS option and find the first file with a name that matches the name of the compiled macro.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The result is a SAS dataset.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;  attrib MACRO length=$32  label='Macro name';
  attrib FOUND length=3    label='Found? (0/1)';
  attrib FILE  length=$36  label='Filename';
  attrib DNAME length=$200 label='Directory name';&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Tue, 21 Oct 2025 20:51:14 GMT</pubDate>
    <dc:creator>Tom</dc:creator>
    <dc:date>2025-10-21T20:51:14Z</dc:date>
    <item>
      <title>How to check which version of a macro function is use</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-check-which-version-of-a-macro-function-is-use/m-p/977544#M46225</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;
OPTIONS MAUTOSOURCE SASAUTOS=("/.../HYFIprep/sasmacro","/.../HYFIp/sasmacro","/.../prod/sasmacro");

%CHECK_ENV; /* pour trouver le numéro de l'environnement sur lequel la job batch est soumise */
%LET SUFENV     = &amp;amp;envN;  /* p pour prod - 1,2,3.... pour la dev */
%LET SASENV     = &amp;amp;envP;  /* Pour les sasyyyy*/

%put &amp;amp;=SUFENV;
%put &amp;amp;=SASENV;

&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Hello the same macro function name %check_env could be found in various subfolder and the version of the macro function could differ a little bit.&amp;nbsp; How to check the version that is trigger?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If I trigger the macro function %check_env from the subfolder /.../HYFIprep does the version of %check_env will be the one from /.../HYFIprep/sasmacro&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 21 Oct 2025 19:45:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-check-which-version-of-a-macro-function-is-use/m-p/977544#M46225</guid>
      <dc:creator>alepage</dc:creator>
      <dc:date>2025-10-21T19:45:25Z</dc:date>
    </item>
    <item>
      <title>Re: How to check which version of a macro function is use</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-check-which-version-of-a-macro-function-is-use/m-p/977545#M46226</link>
      <description>&lt;P&gt;If you set the system option mautocomploc, SAS will write a note to the log when it compiles an autocall macro that shows the file that was compiled, e.g.:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;2   options mautocomploc ;
93   %put %lowcase(foo) ;
MAUTOCOMPLOC:  The autocall macro LOWCASE is compiling using the autocall source file C:\Program
            Files\SASHome\SASFoundation\9.4\core\sasmacro\lowcase.sas.
foo
&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you turn on the option&amp;nbsp;mautolocdisplay, it will write similar information to the log every time an autocall macro is invoked.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;To your second question, calling a macro from a subfolder does not effect which macro will be compiled.&amp;nbsp; When you call %check_env for the first time, SAS will look through the autocall libraries in the order they are listed in SASAUTOS, until it finds a file check_env.sas.&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 21 Oct 2025 20:12:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-check-which-version-of-a-macro-function-is-use/m-p/977545#M46226</guid>
      <dc:creator>Quentin</dc:creator>
      <dc:date>2025-10-21T20:12:46Z</dc:date>
    </item>
    <item>
      <title>Re: How to check which version of a macro function is use</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-check-which-version-of-a-macro-function-is-use/m-p/977546#M46227</link>
      <description>&lt;P&gt;As long as you have not modified the SASAUTOS setting since the time that it was used to find the macro and compile it you could use this macro.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://github.com/sasutils/macros/blob/master/maclist.sas" target="_blank" rel="noopener"&gt;https://github.com/sasutils/macros/blob/master/maclist.sas&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For every compiled macro it will hunt through the paths listed in the SASAUTOS option and find the first file with a name that matches the name of the compiled macro.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The result is a SAS dataset.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;  attrib MACRO length=$32  label='Macro name';
  attrib FOUND length=3    label='Found? (0/1)';
  attrib FILE  length=$36  label='Filename';
  attrib DNAME length=$200 label='Directory name';&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 21 Oct 2025 20:51:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-check-which-version-of-a-macro-function-is-use/m-p/977546#M46227</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2025-10-21T20:51:14Z</dc:date>
    </item>
    <item>
      <title>Re: How to check which version of a macro function is use</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-check-which-version-of-a-macro-function-is-use/m-p/977547#M46228</link>
      <description>&lt;P&gt;Other option I'd recommend would be creating a SAS package out of those macros.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here are two articles explaining why is it a good idea:&lt;/P&gt;
&lt;P&gt;1)&amp;nbsp;&lt;A href="https://pages.mini.pw.edu.pl/~jablonskib/SASpublic/Paper_012-SESUG2025.pdf" target="_blank"&gt;https://pages.mini.pw.edu.pl/~jablonskib/SASpublic/Paper_012-SESUG2025.pdf&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;2)&amp;nbsp;&lt;A href="https://pages.mini.pw.edu.pl/~jablonskib/SASpublic/Paper_116-PharmaSUG2025.pdf" target="_blank"&gt;https://pages.mini.pw.edu.pl/~jablonskib/SASpublic/Paper_116-PharmaSUG2025.pdf&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here is a video presentation (22 minutes):&amp;nbsp;&lt;A href="https://youtu.be/4QRr7sUhO9E" target="_blank"&gt;https://youtu.be/4QRr7sUhO9E&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And here is a tutorial (from 0 to hero):&amp;nbsp;&lt;A href="https://github.com/yabwon/HoW-SASPackages" target="_blank"&gt;https://github.com/yabwon/HoW-SASPackages&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Bart&lt;/P&gt;</description>
      <pubDate>Tue, 21 Oct 2025 20:51:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-check-which-version-of-a-macro-function-is-use/m-p/977547#M46228</guid>
      <dc:creator>yabwon</dc:creator>
      <dc:date>2025-10-21T20:51:34Z</dc:date>
    </item>
    <item>
      <title>Re: How to check which version of a macro function is use</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-check-which-version-of-a-macro-function-is-use/m-p/977552#M46229</link>
      <description>&lt;P&gt;Another option that I'm using frequently for autocall macros: options mautolocdisplay;&lt;/P&gt;
&lt;P&gt;With this option a log message get printed that tells you where the macro has been compiled from whenever you use the macro.&lt;/P&gt;</description>
      <pubDate>Wed, 22 Oct 2025 06:40:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-check-which-version-of-a-macro-function-is-use/m-p/977552#M46229</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2025-10-22T06:40:03Z</dc:date>
    </item>
  </channel>
</rss>

