<?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: Programatically save SAS code to a file in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Programatically-save-SAS-code-to-a-file/m-p/535680#M147127</link>
    <description>&lt;P&gt;Please see my reply to Reeza above for further explanation.&lt;/P&gt;</description>
    <pubDate>Thu, 14 Feb 2019 18:24:01 GMT</pubDate>
    <dc:creator>bmutell</dc:creator>
    <dc:date>2019-02-14T18:24:01Z</dc:date>
    <item>
      <title>Programatically save SAS code to a file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Programatically-save-SAS-code-to-a-file/m-p/535663#M147118</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm wondering if it is possible to write specific lines of a SAS program to a file from that same SAS program and, if so, how to go about that.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance.&lt;/P&gt;</description>
      <pubDate>Thu, 14 Feb 2019 17:57:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Programatically-save-SAS-code-to-a-file/m-p/535663#M147118</guid>
      <dc:creator>bmutell</dc:creator>
      <dc:date>2019-02-14T17:57:59Z</dc:date>
    </item>
    <item>
      <title>Re: Programatically save SAS code to a file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Programatically-save-SAS-code-to-a-file/m-p/535673#M147123</link>
      <description>Do you want to generate code based on some data or dynamically and run that or have your code saved to a specific file with a command?  &lt;BR /&gt;&lt;BR /&gt;The first is easy, the second I have no idea. &lt;BR /&gt;</description>
      <pubDate>Thu, 14 Feb 2019 18:16:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Programatically-save-SAS-code-to-a-file/m-p/535673#M147123</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2019-02-14T18:16:40Z</dc:date>
    </item>
    <item>
      <title>Re: Programatically save SAS code to a file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Programatically-save-SAS-code-to-a-file/m-p/535675#M147124</link>
      <description>&lt;P&gt;I'm looking for a bit more explanation.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In particular, the words "saved&amp;nbsp;&lt;SPAN&gt;to a file from that same SAS program" don't have an obvious meaning to me.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 14 Feb 2019 18:20:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Programatically-save-SAS-code-to-a-file/m-p/535675#M147124</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2019-02-14T18:20:37Z</dc:date>
    </item>
    <item>
      <title>Re: Programatically save SAS code to a file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Programatically-save-SAS-code-to-a-file/m-p/535677#M147125</link>
      <description>&lt;P&gt;It's the latter of those two options. I want to save a macro definition to a file that I can later %INCLUDE into other SAS programs:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;%macro prnt(var,sum);
   proc print data=srhigh;
      var &amp;amp;var;
      sum &amp;amp;sum;
   run;
%mend prnt;&lt;BR /&gt;&lt;BR /&gt;*code to save lines 1-16 to my_macro.sas to C:\Users\me\desktop\;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 14 Feb 2019 18:35:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Programatically-save-SAS-code-to-a-file/m-p/535677#M147125</guid>
      <dc:creator>bmutell</dc:creator>
      <dc:date>2019-02-14T18:35:13Z</dc:date>
    </item>
    <item>
      <title>Re: Programatically save SAS code to a file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Programatically-save-SAS-code-to-a-file/m-p/535680#M147127</link>
      <description>&lt;P&gt;Please see my reply to Reeza above for further explanation.&lt;/P&gt;</description>
      <pubDate>Thu, 14 Feb 2019 18:24:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Programatically-save-SAS-code-to-a-file/m-p/535680#M147127</guid>
      <dc:creator>bmutell</dc:creator>
      <dc:date>2019-02-14T18:24:01Z</dc:date>
    </item>
    <item>
      <title>Re: Programatically save SAS code to a file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Programatically-save-SAS-code-to-a-file/m-p/535690#M147131</link>
      <description>&lt;P&gt;So, let me see if this is what you want. You want a program to browse through your code, and pick out the SAS macro(s), and then save them one-by-one into files on your hard disk or network somewhere, so each can be used via %include in other programs. Is that right?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'm not aware of any tool that does this.&lt;/P&gt;</description>
      <pubDate>Thu, 14 Feb 2019 18:48:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Programatically-save-SAS-code-to-a-file/m-p/535690#M147131</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2019-02-14T18:48:18Z</dc:date>
    </item>
    <item>
      <title>Re: Programatically save SAS code to a file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Programatically-save-SAS-code-to-a-file/m-p/535738#M147142</link>
      <description>&lt;P&gt;Have you tried&amp;nbsp;writing your program to read in the SAS log (save to&amp;nbsp;a named file) and parse the&amp;nbsp;text?&amp;nbsp; You would need to set&amp;nbsp;"OPTIONS MLOGIC SYMBOLGEN" to capture verbose macro output to log.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 14 Feb 2019 20:27:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Programatically-save-SAS-code-to-a-file/m-p/535738#M147142</guid>
      <dc:creator>MSamaniego</dc:creator>
      <dc:date>2019-02-14T20:27:54Z</dc:date>
    </item>
    <item>
      <title>Re: Programatically save SAS code to a file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Programatically-save-SAS-code-to-a-file/m-p/535745#M147145</link>
      <description>I'm trying to understand the logic here, any reason to not just CTRL+S and save the macro? Is the macro code generated somehow? Or just trying to find a full command line interface method?&lt;BR /&gt;</description>
      <pubDate>Thu, 14 Feb 2019 20:45:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Programatically-save-SAS-code-to-a-file/m-p/535745#M147145</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2019-02-14T20:45:22Z</dc:date>
    </item>
    <item>
      <title>Re: Programatically save SAS code to a file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Programatically-save-SAS-code-to-a-file/m-p/535752#M147149</link>
      <description>&lt;P&gt;I think you might theoretically be able to do what you are asking (by reading in the sas program via a datastep and creating another sas program as the output) . But I dont think you should.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If you want a macro to be available to other SAS Programs you should save the macro in an autocall library.&lt;/P&gt;</description>
      <pubDate>Thu, 14 Feb 2019 21:05:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Programatically-save-SAS-code-to-a-file/m-p/535752#M147149</guid>
      <dc:creator>34reqrwe</dc:creator>
      <dc:date>2019-02-14T21:05:04Z</dc:date>
    </item>
    <item>
      <title>Re: Programatically save SAS code to a file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Programatically-save-SAS-code-to-a-file/m-p/827564#M326912</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;Your request is pretty old but this might help some other reader.&lt;/P&gt;
&lt;P&gt;Did you mean something like this, where the content of the macro is saved in another file?&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;
%macro demo (memname=);
%put Message in the log;*won't appear in the new file;
title 'This is a demo';
proc print data=sashelp.&amp;amp;memname.;
run;
%mend demo;


options mfile mprint ;
filename mprint "&amp;amp;xxproject./pgms/new.sas ";
%demo(memname=class);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 08 Aug 2022 09:24:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Programatically-save-SAS-code-to-a-file/m-p/827564#M326912</guid>
      <dc:creator>xxformat_com</dc:creator>
      <dc:date>2022-08-08T09:24:35Z</dc:date>
    </item>
  </channel>
</rss>

