<?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: Writing a Macro program to write or update a .sas file in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Writing-a-Macro-program-to-write-or-update-a-sas-file/m-p/328482#M73344</link>
    <description>&lt;P&gt;I am not sure if this addresses your situation but if you mean that you want to execute some code before executing another SAS program file perhaps you want a control SAS program that includes the other programs. Then you could place the macro calls before/after the include. The control program would look something like:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;%etl_begin ;&lt;/P&gt;
&lt;P&gt;%include "path/SASProgram1.SAS";&lt;/P&gt;
&lt;P&gt;%etl_end;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;%etl_begin ;&lt;/P&gt;
&lt;P&gt;%include "path/SASProgram2.SAS";&lt;/P&gt;
&lt;P&gt;%etl_end;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;%etl_begin ;&lt;/P&gt;
&lt;P&gt;%include "path/SASProgram3.SAS";&lt;/P&gt;
&lt;P&gt;%etl_end;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you have not used %include all it does is in effect read an external progam file into the current program.&lt;/P&gt;</description>
    <pubDate>Mon, 30 Jan 2017 16:01:11 GMT</pubDate>
    <dc:creator>ballardw</dc:creator>
    <dc:date>2017-01-30T16:01:11Z</dc:date>
    <item>
      <title>Writing a Macro program to write or update a .sas file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Writing-a-Macro-program-to-write-or-update-a-sas-file/m-p/328340#M73305</link>
      <description>&lt;P&gt;Hi Guys,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I would like to ask for your help to determine if my idea is possible. I am currently automating a group of .sas program and currently finished writing a macro code that creates a table log or statistics that will send and email. Let's call the macro %etl_begin and %etl_end, this macro should be put on pre and post process part. I need to put this %macros in precode and post code of each .sas file without opening and pasting the macro on the code. Any idea how can I do this? Any time my .sas file increments so i'm thinking I would use a x command line to list all the .sas file on a specific folder.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;</description>
      <pubDate>Mon, 30 Jan 2017 08:48:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Writing-a-Macro-program-to-write-or-update-a-sas-file/m-p/328340#M73305</guid>
      <dc:creator>GabOwen</dc:creator>
      <dc:date>2017-01-30T08:48:34Z</dc:date>
    </item>
    <item>
      <title>Re: Writing a Macro program to write or update a .sas file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Writing-a-Macro-program-to-write-or-update-a-sas-file/m-p/328341#M73306</link>
      <description>&lt;P&gt;.sas files are text files. If your code goes right at beginning and end basic line commands to append the text files should suffice. Look at the command line function called CAT.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://en.m.wikipedia.org/wiki/Cat_(Unix" target="_blank"&gt;https://en.m.wikipedia.org/wiki/Cat_(Unix&lt;/A&gt;)&lt;/P&gt;</description>
      <pubDate>Mon, 30 Jan 2017 08:54:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Writing-a-Macro-program-to-write-or-update-a-sas-file/m-p/328341#M73306</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-01-30T08:54:25Z</dc:date>
    </item>
    <item>
      <title>Re: Writing a Macro program to write or update a .sas file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Writing-a-Macro-program-to-write-or-update-a-sas-file/m-p/328342#M73307</link>
      <description>&lt;P&gt;Also use grep first to determine if the macro calls are already present.&lt;/P&gt;</description>
      <pubDate>Mon, 30 Jan 2017 09:09:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Writing-a-Macro-program-to-write-or-update-a-sas-file/m-p/328342#M73307</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2017-01-30T09:09:34Z</dc:date>
    </item>
    <item>
      <title>Re: Writing a Macro program to write or update a .sas file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Writing-a-Macro-program-to-write-or-update-a-sas-file/m-p/328482#M73344</link>
      <description>&lt;P&gt;I am not sure if this addresses your situation but if you mean that you want to execute some code before executing another SAS program file perhaps you want a control SAS program that includes the other programs. Then you could place the macro calls before/after the include. The control program would look something like:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;%etl_begin ;&lt;/P&gt;
&lt;P&gt;%include "path/SASProgram1.SAS";&lt;/P&gt;
&lt;P&gt;%etl_end;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;%etl_begin ;&lt;/P&gt;
&lt;P&gt;%include "path/SASProgram2.SAS";&lt;/P&gt;
&lt;P&gt;%etl_end;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;%etl_begin ;&lt;/P&gt;
&lt;P&gt;%include "path/SASProgram3.SAS";&lt;/P&gt;
&lt;P&gt;%etl_end;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you have not used %include all it does is in effect read an external progam file into the current program.&lt;/P&gt;</description>
      <pubDate>Mon, 30 Jan 2017 16:01:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Writing-a-Macro-program-to-write-or-update-a-sas-file/m-p/328482#M73344</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2017-01-30T16:01:11Z</dc:date>
    </item>
  </channel>
</rss>

