<?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: Saving the SAS code after the macro processor did its work in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Saving-the-SAS-code-after-the-macro-processor-did-its-work/m-p/885094#M349708</link>
    <description>&lt;P&gt;Thanks, MFILE works perfectly!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 17 Jul 2023 16:20:34 GMT</pubDate>
    <dc:creator>JMS</dc:creator>
    <dc:date>2023-07-17T16:20:34Z</dc:date>
    <item>
      <title>Saving the SAS code after the macro processor did its work</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Saving-the-SAS-code-after-the-macro-processor-did-its-work/m-p/885066#M349695</link>
      <description>&lt;P&gt;I have SAS programs here which are very old and consist of more macro code than sas code. There are hundreds of macros and the nesting level is mor than 5. The main purpose of&amp;nbsp; the macros is to construct statements for the data step. The code of the macros is available as source. It is so much macro code that it is not visible what the code does. Is it possible to save the SAS code after the macro processor did its work? Similar to what MPRINT shows? Would it be possible to write a statement-style macro and name it "data", together with the "implmac" option?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 17 Jul 2023 13:55:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Saving-the-SAS-code-after-the-macro-processor-did-its-work/m-p/885066#M349695</guid>
      <dc:creator>JMS</dc:creator>
      <dc:date>2023-07-17T13:55:30Z</dc:date>
    </item>
    <item>
      <title>Re: Saving the SAS code after the macro processor did its work</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Saving-the-SAS-code-after-the-macro-processor-did-its-work/m-p/885067#M349696</link>
      <description>Do you have access to the macro code? Or is it stored in a macro library?&lt;BR /&gt;There is a paper on understanding the macro facility that you may want to read: &lt;A href="https://support.sas.com/resources/papers/proceedings/proceedings/sugi30/237-30.pdf" target="_blank"&gt;https://support.sas.com/resources/papers/proceedings/proceedings/sugi30/237-30.pdf&lt;/A&gt;</description>
      <pubDate>Mon, 17 Jul 2023 13:39:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Saving-the-SAS-code-after-the-macro-processor-did-its-work/m-p/885067#M349696</guid>
      <dc:creator>JosvanderVelden</dc:creator>
      <dc:date>2023-07-17T13:39:21Z</dc:date>
    </item>
    <item>
      <title>Re: Saving the SAS code after the macro processor did its work</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Saving-the-SAS-code-after-the-macro-processor-did-its-work/m-p/885069#M349698</link>
      <description>The macro source is available.</description>
      <pubDate>Mon, 17 Jul 2023 13:52:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Saving-the-SAS-code-after-the-macro-processor-did-its-work/m-p/885069#M349698</guid>
      <dc:creator>JMS</dc:creator>
      <dc:date>2023-07-17T13:52:45Z</dc:date>
    </item>
    <item>
      <title>Re: Saving the SAS code after the macro processor did its work</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Saving-the-SAS-code-after-the-macro-processor-did-its-work/m-p/885070#M349699</link>
      <description>&lt;P&gt;You can save what MPRINT shows. You can do this manually in the LOG window (File-&amp;gt;Save) or programmatically by using PROC PRINTTO.&lt;/P&gt;</description>
      <pubDate>Mon, 17 Jul 2023 13:55:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Saving-the-SAS-code-after-the-macro-processor-did-its-work/m-p/885070#M349699</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2023-07-17T13:55:27Z</dc:date>
    </item>
    <item>
      <title>Re: Saving the SAS code after the macro processor did its work</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Saving-the-SAS-code-after-the-macro-processor-did-its-work/m-p/885073#M349700</link>
      <description>&lt;P&gt;You might want to look into MFILE, in addition to MPRINT.&amp;nbsp; See e.g.&amp;nbsp;&lt;A href="https://blogs.sas.com/content/sgf/2022/12/21/decode-your-sas-macro-code/" target="_blank"&gt;https://blogs.sas.com/content/sgf/2022/12/21/decode-your-sas-macro-code/&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The thought of an old-style percent-less macro hijacking the DATA statement is pretty scary.&amp;nbsp; I think I vaguely remember someone saying their site used an old-style macro to hijack the LIBNAME statement, so it might be possible.&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I don't know know if MPRINT / MFILE even know about the percent-less macros.&lt;/P&gt;</description>
      <pubDate>Mon, 17 Jul 2023 14:06:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Saving-the-SAS-code-after-the-macro-processor-did-its-work/m-p/885073#M349700</guid>
      <dc:creator>Quentin</dc:creator>
      <dc:date>2023-07-17T14:06:42Z</dc:date>
    </item>
    <item>
      <title>Re: Saving the SAS code after the macro processor did its work</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Saving-the-SAS-code-after-the-macro-processor-did-its-work/m-p/885081#M349702</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/4776"&gt;@JMS&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;I have SAS programs here which are very old and consist of more macro code than sas code. There are hundreds of macros and the nesting level is mor than 5. The main purpose of&amp;nbsp; the macros is to construct statements for the data step. The code of the macros is available as source. It is so much macro code that it is not visible what the code does. Is it possible to save the SAS code after the macro processor did its work? Similar to what MPRINT shows? Would it be possible to write a statement-style macro and name it "data", together with the "implmac" option?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Look at MFILE also.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Or just print it your self:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%put %bquote(%mymacro);
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Example:&lt;/P&gt;
&lt;PRE&gt;1031  %macro mymacro(varname);
1032    &amp;amp;varname = &amp;amp;varname ** 2 ;
1033  %mend;
1034
1035  %put %bquote(%mymacro(x));
x = x ** 2 ;

&lt;/PRE&gt;</description>
      <pubDate>Mon, 17 Jul 2023 14:27:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Saving-the-SAS-code-after-the-macro-processor-did-its-work/m-p/885081#M349702</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2023-07-17T14:27:56Z</dc:date>
    </item>
    <item>
      <title>Re: Saving the SAS code after the macro processor did its work</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Saving-the-SAS-code-after-the-macro-processor-did-its-work/m-p/885094#M349708</link>
      <description>&lt;P&gt;Thanks, MFILE works perfectly!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 17 Jul 2023 16:20:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Saving-the-SAS-code-after-the-macro-processor-did-its-work/m-p/885094#M349708</guid>
      <dc:creator>JMS</dc:creator>
      <dc:date>2023-07-17T16:20:34Z</dc:date>
    </item>
    <item>
      <title>Re: Saving the SAS code after the macro processor did its work</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Saving-the-SAS-code-after-the-macro-processor-did-its-work/m-p/901610#M356303</link>
      <description>&lt;LI-CODE lang="sas"&gt;%put %bquote(%mymacro);&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This is interesting! Thanks!&lt;/P&gt;</description>
      <pubDate>Sun, 05 Nov 2023 07:51:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Saving-the-SAS-code-after-the-macro-processor-did-its-work/m-p/901610#M356303</guid>
      <dc:creator>JMS</dc:creator>
      <dc:date>2023-11-05T07:51:26Z</dc:date>
    </item>
  </channel>
</rss>

