<?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: date check in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/date-check/m-p/473512#M285881</link>
    <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql noprint;
select max(month) into :mnth from table;
quit;

%macro datecheck;
%if %sysfunc(intnx(month,&amp;amp;mnth,0,b)) = %sysfunc(intnx(month,%sysfunc(today()),-1,b))
%then %do; /* last month */
/* some queries */
%end;
%else %do; /* other month */
/* some other queries */
%end;
%mend;
%datecheck&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Tue, 26 Jun 2018 18:27:14 GMT</pubDate>
    <dc:creator>Kurt_Bremser</dc:creator>
    <dc:date>2018-06-26T18:27:14Z</dc:date>
    <item>
      <title>date check</title>
      <link>https://communities.sas.com/t5/SAS-Programming/date-check/m-p/473510#M285880</link>
      <description>&lt;P&gt;okay, so i need to, as a part of a larger process, check if the date in a field (MONTH) has last months date in it.&amp;nbsp; if it does it needs to run a series of queries and if it does not, then run other queries.&amp;nbsp;&amp;nbsp; i am just missing how to figure this out.&amp;nbsp; i assume to do it, it needs to be run from a macro so something like...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;%macro datecheck;&lt;/P&gt;&lt;P&gt;%local qry mnthck&lt;/P&gt;&lt;P&gt;%let qry=(proc sql; select max(MONTH) as MNTH from TABLE; quit;);&lt;/P&gt;&lt;P&gt;%let today=%sysfunc(today());&lt;/P&gt;&lt;P&gt;%let lmnth=%sysfunc(intnx(month,&amp;amp;today,-1));&lt;/P&gt;&lt;P&gt;%if &amp;amp;lmnth=&amp;amp;qry %then&lt;/P&gt;&lt;P&gt;%do;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;list of queries to run...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;%end;&lt;/P&gt;&lt;P&gt;%mend datecheck;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;any help?&amp;nbsp; obviously that does not work but i am also not far off from getting the right answer.&amp;nbsp; i am just missing the part of getting the query results.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 26 Jun 2018 18:11:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/date-check/m-p/473510#M285880</guid>
      <dc:creator>me55</dc:creator>
      <dc:date>2018-06-26T18:11:42Z</dc:date>
    </item>
    <item>
      <title>Re: date check</title>
      <link>https://communities.sas.com/t5/SAS-Programming/date-check/m-p/473512#M285881</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql noprint;
select max(month) into :mnth from table;
quit;

%macro datecheck;
%if %sysfunc(intnx(month,&amp;amp;mnth,0,b)) = %sysfunc(intnx(month,%sysfunc(today()),-1,b))
%then %do; /* last month */
/* some queries */
%end;
%else %do; /* other month */
/* some other queries */
%end;
%mend;
%datecheck&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 26 Jun 2018 18:27:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/date-check/m-p/473512#M285881</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2018-06-26T18:27:14Z</dc:date>
    </item>
  </channel>
</rss>

