<?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 Macro From Manual to Automated? in SAS Enterprise Guide</title>
    <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Macro-From-Manual-to-Automated/m-p/312393#M21092</link>
    <description>&lt;P&gt;I have the following macro that allows me to pull all information for the most recent months into my analysis.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;%let calyear = 2016;&lt;BR /&gt;%let month = 10;&lt;BR /&gt;%let YYYYMM = 201610;&lt;/P&gt;&lt;P&gt;I have to change the month, year, &amp;amp; calyear as needed.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Let's say I wanted to schedule this proces to run on the 15th of every month and it would always pull the previous month?&lt;/P&gt;&lt;P&gt;I have four process flows that link to these variables and pull the data.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Does anyone have any tips on this?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Scottie&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 17 Nov 2016 17:06:25 GMT</pubDate>
    <dc:creator>Scottie_T</dc:creator>
    <dc:date>2016-11-17T17:06:25Z</dc:date>
    <item>
      <title>Macro From Manual to Automated?</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Macro-From-Manual-to-Automated/m-p/312393#M21092</link>
      <description>&lt;P&gt;I have the following macro that allows me to pull all information for the most recent months into my analysis.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;%let calyear = 2016;&lt;BR /&gt;%let month = 10;&lt;BR /&gt;%let YYYYMM = 201610;&lt;/P&gt;&lt;P&gt;I have to change the month, year, &amp;amp; calyear as needed.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Let's say I wanted to schedule this proces to run on the 15th of every month and it would always pull the previous month?&lt;/P&gt;&lt;P&gt;I have four process flows that link to these variables and pull the data.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Does anyone have any tips on this?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Scottie&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 17 Nov 2016 17:06:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Macro-From-Manual-to-Automated/m-p/312393#M21092</guid>
      <dc:creator>Scottie_T</dc:creator>
      <dc:date>2016-11-17T17:06:25Z</dc:date>
    </item>
    <item>
      <title>Re: Macro From Manual to Automated?</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Macro-From-Manual-to-Automated/m-p/312401#M21093</link>
      <description>&lt;P&gt;Well, I know nobody really uses base SAS any more (/sarcasm). &amp;nbsp;It has lots of functions for date manipulations, data structures associated with dates, your code looks like:&lt;/P&gt;
&lt;PRE&gt;data _null_;
  call symputx("CALYEAR",year(datepart(today())));
  call symput("MONTH",month(datepart(today())));
  call symput("YYYYMM",cats(year(datepart(today())),month(datepart(today()))));
run;

%put &amp;amp;CALYEAR., &amp;amp;MONTH., &amp;amp;YYYYMM.;&lt;/PRE&gt;
&lt;P&gt;The above creates your macro variables base on the date of run. &amp;nbsp;I would of course advise that there are better ways to do this, use datasets for your parameters etc. &amp;nbsp;Macro language is text only and doesn't do anything other than create text strings.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 17 Nov 2016 17:20:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Macro-From-Manual-to-Automated/m-p/312401#M21093</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2016-11-17T17:20:56Z</dc:date>
    </item>
  </channel>
</rss>

