<?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 How to: Use current date to execute macro and pass date parameters in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-to-Use-current-date-to-execute-macro-and-pass-date/m-p/776245#M246827</link>
    <description>&lt;P&gt;I'm very new to SAS would like to use use the current date to determine whether on not to execute a macro that passes date parameters to another macro. I've been editing each month to comment out the part I don't need to execute, but I'm sure there has to be a more elegant way.&amp;nbsp;This is basically what I have now:&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;DIV&gt;%macro pull_accounts(date, datelabel);&lt;/DIV&gt;&lt;DIV&gt;/* date in yyyy-mm-dd date label in ddMMMyyyy */&lt;/DIV&gt;&lt;DIV&gt;/* Create table of latest events per account */&lt;/DIV&gt;&lt;DIV&gt;%let asof = Date(&amp;amp;date.);&lt;/DIV&gt;&lt;DIV&gt;%let asoflab = &amp;amp;datelabel.;&lt;/DIV&gt;&lt;DIV&gt;%let str1 &amp;nbsp;= %STR(&lt;/DIV&gt;&lt;DIV&gt;with table1 as&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;(Select a.field1,&amp;nbsp;a.field2,&amp;nbsp;a.field3,&amp;nbsp;a.field4,&amp;nbsp;b.field1,&amp;nbsp;c.field1,&amp;nbsp;d.field1,&amp;nbsp;d.field2,&amp;nbsp;d.field3,&amp;nbsp;e.field1,&lt;/DIV&gt;&lt;DIV&gt;row_number() over (partition by a.field2&amp;nbsp;&lt;SPAN style="font-family: inherit;"&gt;order by a.&lt;/SPAN&gt;&lt;SPAN style="font-family: inherit;"&gt;field3, d.&lt;/SPAN&gt;&lt;SPAN style="font-family: inherit;"&gt;field2, a.field1)&amp;nbsp;&lt;/SPAN&gt;as row,&lt;/DIV&gt;&lt;DIV&gt;row_number() over&amp;nbsp;(partition by a.field2&amp;nbsp;order by a.field3)&amp;nbsp;as row_earliest&lt;/DIV&gt;&lt;DIV&gt;from a&lt;/DIV&gt;&lt;DIV&gt;left join b&amp;nbsp;on a.field1 = b.field2&lt;/DIV&gt;&lt;DIV&gt;left join c&amp;nbsp;on a.field1 = c.field2&lt;/DIV&gt;&lt;DIV&gt;left join d&amp;nbsp;on a.field1 = d.field4&lt;/DIV&gt;&lt;DIV&gt;left join e&amp;nbsp;on d.field5 = e.field2&lt;/DIV&gt;&lt;DIV&gt;where (a.field2 &amp;lt;= d.field5 and d.field1 &amp;lt;= &amp;amp;asof.)&lt;/DIV&gt;&lt;DIV&gt;and (a.field3 is null or a.field3&amp;gt;= &amp;amp;asof.)),&lt;/DIV&gt;&lt;DIV&gt;/*followed by several more intermediate tables then a final results table*/&lt;/DIV&gt;&lt;DIV&gt;);&lt;/DIV&gt;&lt;DIV&gt;PROC SQL FEEDBACK;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; CONNECT TO REDSHIFT (&amp;amp;MyLibe DSN="My-Reports" AUTHDOMAIN="My-Reports-Auth");&lt;/DIV&gt;&lt;DIV&gt;CREATE TABLE work.last_event_&amp;amp;asoflab. AS&lt;/DIV&gt;&lt;DIV&gt;SELECT * FROM CONNECTION TO REDSHIFT (%QSYSFUNC(DEQUOTE(&amp;amp;str1)));&lt;/DIV&gt;&lt;DIV&gt;QUIT;&lt;/DIV&gt;&lt;DIV&gt;%mend pull_accounts;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;%pull_accounts('2021-06-01', 01JUN2021);&lt;/DIV&gt;&lt;DIV&gt;%pull_accounts('2021-07-01', 01JUL2021);&lt;/DIV&gt;&lt;DIV&gt;%pull_accounts('2021-08-01', 01AUG2021);&lt;/DIV&gt;&lt;DIV&gt;%pull_accounts('2021-09-30', 30SEP2021);&lt;/DIV&gt;&lt;DIV&gt;/*%pull_accounts('2021-10-31', 31OCT2021);&lt;/DIV&gt;&lt;DIV&gt;%pull_accounts('2021-11-30', 30NOV2021);&lt;/DIV&gt;&lt;DIV&gt;%pull_accounts('2021-12-31', 31DEC2021);&lt;/DIV&gt;&lt;DIV&gt;%pull_accounts('2022-01-31', 31JAN2022);&lt;/DIV&gt;&lt;DIV&gt;%pull_accounts('2022-02-28', 28FEB2022);&lt;/DIV&gt;&lt;DIV&gt;%pull_accounts('2022-03-31', 31MAR2022);&lt;/DIV&gt;&lt;DIV&gt;%pull_accounts('2022-04-30', 30APR2022);&lt;/DIV&gt;&lt;DIV&gt;%pull_accounts('2022-05-31', 31MAY2022);*/&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;%hive_drop_table(my_datasets,last_per_month);&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;data lib_hive.last_per_month;&lt;/DIV&gt;&lt;DIV&gt;month = .;&lt;/DIV&gt;&lt;DIV&gt;year = .;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; set work.last_event_01JUN2021&lt;/DIV&gt;&lt;DIV&gt;work.last_event_01JUL2021&lt;/DIV&gt;&lt;DIV&gt;work.last_event_01AUG2021&lt;/DIV&gt;&lt;DIV&gt;work.last_event_30SEP2021&lt;/DIV&gt;&lt;DIV&gt;/*work.last_event_31OCT2021&lt;/DIV&gt;&lt;DIV&gt;work.last_event_30NOV2021&lt;/DIV&gt;&lt;DIV&gt;work.last_event_31DEC2021&lt;/DIV&gt;&lt;DIV&gt;work.last_event_31JAN2022&lt;/DIV&gt;&lt;DIV&gt;work.last_event_28FEB2022&lt;/DIV&gt;&lt;DIV&gt;work.last_event_31MAR2022&lt;/DIV&gt;&lt;DIV&gt;work.last_event_30APR2022&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;work.last_event_31MAY2022 */;&lt;/DIV&gt;&lt;DIV&gt;month = month(asof);&lt;/DIV&gt;&lt;DIV&gt;year = year(asof);&lt;/DIV&gt;&lt;DIV&gt;run;&lt;/DIV&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;Each month I shift to comment out the next section, but what I would like to be do is check the current date and only execute the macros where the dates being passed are after today's date.&lt;/P&gt;</description>
    <pubDate>Mon, 25 Oct 2021 17:24:07 GMT</pubDate>
    <dc:creator>jlhutch</dc:creator>
    <dc:date>2021-10-25T17:24:07Z</dc:date>
    <item>
      <title>How to: Use current date to execute macro and pass date parameters</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-Use-current-date-to-execute-macro-and-pass-date/m-p/776245#M246827</link>
      <description>&lt;P&gt;I'm very new to SAS would like to use use the current date to determine whether on not to execute a macro that passes date parameters to another macro. I've been editing each month to comment out the part I don't need to execute, but I'm sure there has to be a more elegant way.&amp;nbsp;This is basically what I have now:&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;DIV&gt;%macro pull_accounts(date, datelabel);&lt;/DIV&gt;&lt;DIV&gt;/* date in yyyy-mm-dd date label in ddMMMyyyy */&lt;/DIV&gt;&lt;DIV&gt;/* Create table of latest events per account */&lt;/DIV&gt;&lt;DIV&gt;%let asof = Date(&amp;amp;date.);&lt;/DIV&gt;&lt;DIV&gt;%let asoflab = &amp;amp;datelabel.;&lt;/DIV&gt;&lt;DIV&gt;%let str1 &amp;nbsp;= %STR(&lt;/DIV&gt;&lt;DIV&gt;with table1 as&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;(Select a.field1,&amp;nbsp;a.field2,&amp;nbsp;a.field3,&amp;nbsp;a.field4,&amp;nbsp;b.field1,&amp;nbsp;c.field1,&amp;nbsp;d.field1,&amp;nbsp;d.field2,&amp;nbsp;d.field3,&amp;nbsp;e.field1,&lt;/DIV&gt;&lt;DIV&gt;row_number() over (partition by a.field2&amp;nbsp;&lt;SPAN style="font-family: inherit;"&gt;order by a.&lt;/SPAN&gt;&lt;SPAN style="font-family: inherit;"&gt;field3, d.&lt;/SPAN&gt;&lt;SPAN style="font-family: inherit;"&gt;field2, a.field1)&amp;nbsp;&lt;/SPAN&gt;as row,&lt;/DIV&gt;&lt;DIV&gt;row_number() over&amp;nbsp;(partition by a.field2&amp;nbsp;order by a.field3)&amp;nbsp;as row_earliest&lt;/DIV&gt;&lt;DIV&gt;from a&lt;/DIV&gt;&lt;DIV&gt;left join b&amp;nbsp;on a.field1 = b.field2&lt;/DIV&gt;&lt;DIV&gt;left join c&amp;nbsp;on a.field1 = c.field2&lt;/DIV&gt;&lt;DIV&gt;left join d&amp;nbsp;on a.field1 = d.field4&lt;/DIV&gt;&lt;DIV&gt;left join e&amp;nbsp;on d.field5 = e.field2&lt;/DIV&gt;&lt;DIV&gt;where (a.field2 &amp;lt;= d.field5 and d.field1 &amp;lt;= &amp;amp;asof.)&lt;/DIV&gt;&lt;DIV&gt;and (a.field3 is null or a.field3&amp;gt;= &amp;amp;asof.)),&lt;/DIV&gt;&lt;DIV&gt;/*followed by several more intermediate tables then a final results table*/&lt;/DIV&gt;&lt;DIV&gt;);&lt;/DIV&gt;&lt;DIV&gt;PROC SQL FEEDBACK;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; CONNECT TO REDSHIFT (&amp;amp;MyLibe DSN="My-Reports" AUTHDOMAIN="My-Reports-Auth");&lt;/DIV&gt;&lt;DIV&gt;CREATE TABLE work.last_event_&amp;amp;asoflab. AS&lt;/DIV&gt;&lt;DIV&gt;SELECT * FROM CONNECTION TO REDSHIFT (%QSYSFUNC(DEQUOTE(&amp;amp;str1)));&lt;/DIV&gt;&lt;DIV&gt;QUIT;&lt;/DIV&gt;&lt;DIV&gt;%mend pull_accounts;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;%pull_accounts('2021-06-01', 01JUN2021);&lt;/DIV&gt;&lt;DIV&gt;%pull_accounts('2021-07-01', 01JUL2021);&lt;/DIV&gt;&lt;DIV&gt;%pull_accounts('2021-08-01', 01AUG2021);&lt;/DIV&gt;&lt;DIV&gt;%pull_accounts('2021-09-30', 30SEP2021);&lt;/DIV&gt;&lt;DIV&gt;/*%pull_accounts('2021-10-31', 31OCT2021);&lt;/DIV&gt;&lt;DIV&gt;%pull_accounts('2021-11-30', 30NOV2021);&lt;/DIV&gt;&lt;DIV&gt;%pull_accounts('2021-12-31', 31DEC2021);&lt;/DIV&gt;&lt;DIV&gt;%pull_accounts('2022-01-31', 31JAN2022);&lt;/DIV&gt;&lt;DIV&gt;%pull_accounts('2022-02-28', 28FEB2022);&lt;/DIV&gt;&lt;DIV&gt;%pull_accounts('2022-03-31', 31MAR2022);&lt;/DIV&gt;&lt;DIV&gt;%pull_accounts('2022-04-30', 30APR2022);&lt;/DIV&gt;&lt;DIV&gt;%pull_accounts('2022-05-31', 31MAY2022);*/&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;%hive_drop_table(my_datasets,last_per_month);&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;data lib_hive.last_per_month;&lt;/DIV&gt;&lt;DIV&gt;month = .;&lt;/DIV&gt;&lt;DIV&gt;year = .;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; set work.last_event_01JUN2021&lt;/DIV&gt;&lt;DIV&gt;work.last_event_01JUL2021&lt;/DIV&gt;&lt;DIV&gt;work.last_event_01AUG2021&lt;/DIV&gt;&lt;DIV&gt;work.last_event_30SEP2021&lt;/DIV&gt;&lt;DIV&gt;/*work.last_event_31OCT2021&lt;/DIV&gt;&lt;DIV&gt;work.last_event_30NOV2021&lt;/DIV&gt;&lt;DIV&gt;work.last_event_31DEC2021&lt;/DIV&gt;&lt;DIV&gt;work.last_event_31JAN2022&lt;/DIV&gt;&lt;DIV&gt;work.last_event_28FEB2022&lt;/DIV&gt;&lt;DIV&gt;work.last_event_31MAR2022&lt;/DIV&gt;&lt;DIV&gt;work.last_event_30APR2022&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;work.last_event_31MAY2022 */;&lt;/DIV&gt;&lt;DIV&gt;month = month(asof);&lt;/DIV&gt;&lt;DIV&gt;year = year(asof);&lt;/DIV&gt;&lt;DIV&gt;run;&lt;/DIV&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;Each month I shift to comment out the next section, but what I would like to be do is check the current date and only execute the macros where the dates being passed are after today's date.&lt;/P&gt;</description>
      <pubDate>Mon, 25 Oct 2021 17:24:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-Use-current-date-to-execute-macro-and-pass-date/m-p/776245#M246827</guid>
      <dc:creator>jlhutch</dc:creator>
      <dc:date>2021-10-25T17:24:07Z</dc:date>
    </item>
    <item>
      <title>Re: How to: Use current date to execute macro and pass date parameters</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-Use-current-date-to-execute-macro-and-pass-date/m-p/776267#M246834</link>
      <description>&lt;P&gt;I remember there being a similar example in this book. The author showed how to use macro variables do automate a report by date based on a condition.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://www.sas.com/storefront/aux/en/spmacromagic/66301_excerpt.pdf" target="_blank"&gt;Chapter 5 (sas.com)&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 25 Oct 2021 18:31:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-Use-current-date-to-execute-macro-and-pass-date/m-p/776267#M246834</guid>
      <dc:creator>svh</dc:creator>
      <dc:date>2021-10-25T18:31:08Z</dc:date>
    </item>
    <item>
      <title>Re: How to: Use current date to execute macro and pass date parameters</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-Use-current-date-to-execute-macro-and-pass-date/m-p/776276#M246840</link>
      <description>&lt;P&gt;Refactor your code to use a data set not manual calls and then you can easily filter it based on a date.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Note that I accounted for the change in beginning of the month intervals to end of month intervals with the INTERVAL variable. E means end of the month, B means beginning of the month. Uncomment the CALL EXECUTE to see the macro code actually run. You can change that step to a data _null_ step as well once you've confirmed it's working.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data date_calls;
date_start = '01Jun2021'd;
interval = 'b';
do i=1 to 12;
if month(_date) &amp;gt;=8 then interval = 'e';
_date = intnx('month', date_start, i-1, interval);

date = quote(put(_date, yymmddd10.));
date_label = put(_date, date9.);
output;
end;
run;

data macro_execution;
set date_calls;
where _date &amp;lt;= today();

str = catt('%pull_accounts(', 
             date,
             ' , ',
             date_label,
             ');');
*call execute(str);
run;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/403876"&gt;@jlhutch&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;I'm very new to SAS would like to use use the current date to determine whether on not to execute a macro that passes date parameters to another macro. I've been editing each month to comment out the part I don't need to execute, but I'm sure there has to be a more elegant way.&amp;nbsp;This is basically what I have now:&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;DIV&gt;%macro pull_accounts(date, datelabel);&lt;/DIV&gt;
&lt;DIV&gt;/* date in yyyy-mm-dd date label in ddMMMyyyy */&lt;/DIV&gt;
&lt;DIV&gt;/* Create table of latest events per account */&lt;/DIV&gt;
&lt;DIV&gt;%let asof = Date(&amp;amp;date.);&lt;/DIV&gt;
&lt;DIV&gt;%let asoflab = &amp;amp;datelabel.;&lt;/DIV&gt;
&lt;DIV&gt;%let str1 &amp;nbsp;= %STR(&lt;/DIV&gt;
&lt;DIV&gt;with table1 as&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;(Select a.field1,&amp;nbsp;a.field2,&amp;nbsp;a.field3,&amp;nbsp;a.field4,&amp;nbsp;b.field1,&amp;nbsp;c.field1,&amp;nbsp;d.field1,&amp;nbsp;d.field2,&amp;nbsp;d.field3,&amp;nbsp;e.field1,&lt;/DIV&gt;
&lt;DIV&gt;row_number() over (partition by a.field2&amp;nbsp;&lt;SPAN style="font-family: inherit;"&gt;order by a.&lt;/SPAN&gt;&lt;SPAN style="font-family: inherit;"&gt;field3, d.&lt;/SPAN&gt;&lt;SPAN style="font-family: inherit;"&gt;field2, a.field1)&amp;nbsp;&lt;/SPAN&gt;as row,&lt;/DIV&gt;
&lt;DIV&gt;row_number() over&amp;nbsp;(partition by a.field2&amp;nbsp;order by a.field3)&amp;nbsp;as row_earliest&lt;/DIV&gt;
&lt;DIV&gt;from a&lt;/DIV&gt;
&lt;DIV&gt;left join b&amp;nbsp;on a.field1 = b.field2&lt;/DIV&gt;
&lt;DIV&gt;left join c&amp;nbsp;on a.field1 = c.field2&lt;/DIV&gt;
&lt;DIV&gt;left join d&amp;nbsp;on a.field1 = d.field4&lt;/DIV&gt;
&lt;DIV&gt;left join e&amp;nbsp;on d.field5 = e.field2&lt;/DIV&gt;
&lt;DIV&gt;where (a.field2 &amp;lt;= d.field5 and d.field1 &amp;lt;= &amp;amp;asof.)&lt;/DIV&gt;
&lt;DIV&gt;and (a.field3 is null or a.field3&amp;gt;= &amp;amp;asof.)),&lt;/DIV&gt;
&lt;DIV&gt;/*followed by several more intermediate tables then a final results table*/&lt;/DIV&gt;
&lt;DIV&gt;);&lt;/DIV&gt;
&lt;DIV&gt;PROC SQL FEEDBACK;&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp; &amp;nbsp; CONNECT TO REDSHIFT (&amp;amp;MyLibe DSN="My-Reports" AUTHDOMAIN="My-Reports-Auth");&lt;/DIV&gt;
&lt;DIV&gt;CREATE TABLE work.last_event_&amp;amp;asoflab. AS&lt;/DIV&gt;
&lt;DIV&gt;SELECT * FROM CONNECTION TO REDSHIFT (%QSYSFUNC(DEQUOTE(&amp;amp;str1)));&lt;/DIV&gt;
&lt;DIV&gt;QUIT;&lt;/DIV&gt;
&lt;DIV&gt;%mend pull_accounts;&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;%pull_accounts('2021-06-01', 01JUN2021);&lt;/DIV&gt;
&lt;DIV&gt;%pull_accounts('2021-07-01', 01JUL2021);&lt;/DIV&gt;
&lt;DIV&gt;%pull_accounts('2021-08-01', 01AUG2021);&lt;/DIV&gt;
&lt;DIV&gt;%pull_accounts('2021-09-30', 30SEP2021);&lt;/DIV&gt;
&lt;DIV&gt;/*%pull_accounts('2021-10-31', 31OCT2021);&lt;/DIV&gt;
&lt;DIV&gt;%pull_accounts('2021-11-30', 30NOV2021);&lt;/DIV&gt;
&lt;DIV&gt;%pull_accounts('2021-12-31', 31DEC2021);&lt;/DIV&gt;
&lt;DIV&gt;%pull_accounts('2022-01-31', 31JAN2022);&lt;/DIV&gt;
&lt;DIV&gt;%pull_accounts('2022-02-28', 28FEB2022);&lt;/DIV&gt;
&lt;DIV&gt;%pull_accounts('2022-03-31', 31MAR2022);&lt;/DIV&gt;
&lt;DIV&gt;%pull_accounts('2022-04-30', 30APR2022);&lt;/DIV&gt;
&lt;DIV&gt;%pull_accounts('2022-05-31', 31MAY2022);*/&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;%hive_drop_table(my_datasets,last_per_month);&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;data lib_hive.last_per_month;&lt;/DIV&gt;
&lt;DIV&gt;month = .;&lt;/DIV&gt;
&lt;DIV&gt;year = .;&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp; set work.last_event_01JUN2021&lt;/DIV&gt;
&lt;DIV&gt;work.last_event_01JUL2021&lt;/DIV&gt;
&lt;DIV&gt;work.last_event_01AUG2021&lt;/DIV&gt;
&lt;DIV&gt;work.last_event_30SEP2021&lt;/DIV&gt;
&lt;DIV&gt;/*work.last_event_31OCT2021&lt;/DIV&gt;
&lt;DIV&gt;work.last_event_30NOV2021&lt;/DIV&gt;
&lt;DIV&gt;work.last_event_31DEC2021&lt;/DIV&gt;
&lt;DIV&gt;work.last_event_31JAN2022&lt;/DIV&gt;
&lt;DIV&gt;work.last_event_28FEB2022&lt;/DIV&gt;
&lt;DIV&gt;work.last_event_31MAR2022&lt;/DIV&gt;
&lt;DIV&gt;work.last_event_30APR2022&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;work.last_event_31MAY2022 */;&lt;/DIV&gt;
&lt;DIV&gt;month = month(asof);&lt;/DIV&gt;
&lt;DIV&gt;year = year(asof);&lt;/DIV&gt;
&lt;DIV&gt;run;&lt;/DIV&gt;
&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Each month I shift to comment out the next section, but what I would like to be do is check the current date and only execute the macros where the dates being passed are after today's date.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 25 Oct 2021 19:19:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-Use-current-date-to-execute-macro-and-pass-date/m-p/776276#M246840</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2021-10-25T19:19:16Z</dc:date>
    </item>
    <item>
      <title>Re: How to: Use current date to execute macro and pass date parameters</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-Use-current-date-to-execute-macro-and-pass-date/m-p/776732#M247075</link>
      <description>Thanks! I only had to make one tiny adjustment because I need the output for date to be single quoted.&lt;BR /&gt;I changed: date = quote(put(_date, yymmddd10.));&lt;BR /&gt;to: date = quote(put(_date, yymmddd10.),"'");</description>
      <pubDate>Wed, 27 Oct 2021 13:40:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-Use-current-date-to-execute-macro-and-pass-date/m-p/776732#M247075</guid>
      <dc:creator>jlhutch</dc:creator>
      <dc:date>2021-10-27T13:40:07Z</dc:date>
    </item>
  </channel>
</rss>

