<?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: List of macros which are used in a program in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/List-of-macros-which-are-used-in-a-program/m-p/725445#M225341</link>
    <description>&lt;P&gt;Not an easy way.&amp;nbsp; Especially when macros can be nested three or four deep.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best would probably be to take a log of the program (run with MPRINT turned out) and parse it to locate the macro names from the log.&amp;nbsp; Then sort and remove duplicate names.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Even so, that doesn't tell you the library that holds the macro.&amp;nbsp; There could be more than one macro library.&lt;/P&gt;</description>
    <pubDate>Thu, 11 Mar 2021 14:01:14 GMT</pubDate>
    <dc:creator>Astounding</dc:creator>
    <dc:date>2021-03-11T14:01:14Z</dc:date>
    <item>
      <title>List of macros which are used in a program</title>
      <link>https://communities.sas.com/t5/SAS-Programming/List-of-macros-which-are-used-in-a-program/m-p/725433#M225337</link>
      <description>&lt;P&gt;Hello Team,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How i can get list macros which are used in a single program.&lt;/P&gt;&lt;P&gt;In one program used 5 macros and 3 of macros have 10 nested macros.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So i need to get list of all macros names with nested macros names in a program.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you,&lt;/P&gt;&lt;P&gt;Rajasekhar.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 11 Mar 2021 13:41:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/List-of-macros-which-are-used-in-a-program/m-p/725433#M225337</guid>
      <dc:creator>raja777pharma</dc:creator>
      <dc:date>2021-03-11T13:41:53Z</dc:date>
    </item>
    <item>
      <title>Re: List of macros which are used in a program</title>
      <link>https://communities.sas.com/t5/SAS-Programming/List-of-macros-which-are-used-in-a-program/m-p/725445#M225341</link>
      <description>&lt;P&gt;Not an easy way.&amp;nbsp; Especially when macros can be nested three or four deep.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best would probably be to take a log of the program (run with MPRINT turned out) and parse it to locate the macro names from the log.&amp;nbsp; Then sort and remove duplicate names.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Even so, that doesn't tell you the library that holds the macro.&amp;nbsp; There could be more than one macro library.&lt;/P&gt;</description>
      <pubDate>Thu, 11 Mar 2021 14:01:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/List-of-macros-which-are-used-in-a-program/m-p/725445#M225341</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2021-03-11T14:01:14Z</dc:date>
    </item>
    <item>
      <title>Re: List of macros which are used in a program</title>
      <link>https://communities.sas.com/t5/SAS-Programming/List-of-macros-which-are-used-in-a-program/m-p/725498#M225368</link>
      <description>&lt;P&gt;Try PROC SCAPROC but I don't think anything will get it for you. Also, do you need to separate user defined macros from automatic macros?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you're only compiling the macros in the process of this program you could look at which macros are available before and after running the code, I think it's stored in a catalogue but cannot remember the specifics so hopefully someone else can :).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 11 Mar 2021 16:32:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/List-of-macros-which-are-used-in-a-program/m-p/725498#M225368</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2021-03-11T16:32:39Z</dc:date>
    </item>
    <item>
      <title>Re: List of macros which are used in a program</title>
      <link>https://communities.sas.com/t5/SAS-Programming/List-of-macros-which-are-used-in-a-program/m-p/725504#M225370</link>
      <description>&lt;P&gt;Parsing SAS code is hard, so trying to predict in advance of running would be difficult.&amp;nbsp; You could try scanning for text that looks %xxxx and eliminate the known macro keywords and functions from the list.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you are using AUTOCALL to locate and compile the macros you could run the program and then examine the contents of the catalog where SAS stored the macros it compiles.&amp;nbsp; &amp;nbsp;There are also some new options in SAS that enable writing notes to the SAS log when it compiles a macro.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;TABLE&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TH style="width: 25%;"&gt;MAUTOCOMPLOC&lt;/TH&gt;
&lt;TD&gt;Displays in the SAS log the source location of the autocall macros when the autocall macro is compiled.&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TH&gt;MAUTOLOCDISPLAY&lt;/TH&gt;
&lt;TD&gt;Displays the source location of the autocall macros in the SAS log when the autocall macro is invoked.&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TH&gt;MAUTOLOCINDES&lt;/TH&gt;
&lt;TD&gt;Specifies whether the macro processor prepends the full pathname of the autocall source file to the description field of the catalog entry of compiled auto call macro definition in the Work.SASMacr catalog.&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also note that trying to rely on MPRINT option will only find the macros that generate SAS code. Any macro that only generates macro code will not produce any MPRINT lines.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Note detecting the macros used during a run will only find the ones actually called during &lt;STRONG&gt;this&lt;/STRONG&gt; run of the program, not any other macros that it might have called if the input data had been different.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 11 Mar 2021 16:48:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/List-of-macros-which-are-used-in-a-program/m-p/725504#M225370</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2021-03-11T16:48:43Z</dc:date>
    </item>
    <item>
      <title>Re: List of macros which are used in a program</title>
      <link>https://communities.sas.com/t5/SAS-Programming/List-of-macros-which-are-used-in-a-program/m-p/725709#M225471</link>
      <description>&lt;P&gt;hi Tom,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for suggestion.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I will try to use those options will try to get list from sas log.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you,&lt;/P&gt;&lt;P&gt;Rajasekhar&lt;/P&gt;</description>
      <pubDate>Fri, 12 Mar 2021 05:02:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/List-of-macros-which-are-used-in-a-program/m-p/725709#M225471</guid>
      <dc:creator>raja777pharma</dc:creator>
      <dc:date>2021-03-12T05:02:27Z</dc:date>
    </item>
  </channel>
</rss>

