<?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 auto fetching of dates in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/auto-fetching-of-dates/m-p/440112#M109891</link>
    <description>&lt;P&gt;Hi ,&lt;/P&gt;&lt;P&gt;I am looking for auto date fetching;&lt;/P&gt;&lt;P&gt;e.g start date='05feb2018'd&amp;nbsp;&lt;/P&gt;&lt;P&gt;i want to fetch auto date for every next month i.e. 5th day of every month should be the start date.&lt;/P&gt;&lt;P&gt;.eg. for next month when the program is auto run it should fetch the start date as 5th day of next month.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Similarly end date should be last day of every current month.&lt;/P&gt;&lt;P&gt;e.g end_date='28thfeb2018'd for feb ...for march it should&amp;nbsp;fetch the last date e.g. end_date='31March2018'.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Also let me know how can we code it in EG using the query builder.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
    <pubDate>Mon, 26 Feb 2018 05:11:13 GMT</pubDate>
    <dc:creator>anirudhs</dc:creator>
    <dc:date>2018-02-26T05:11:13Z</dc:date>
    <item>
      <title>auto fetching of dates</title>
      <link>https://communities.sas.com/t5/SAS-Programming/auto-fetching-of-dates/m-p/440112#M109891</link>
      <description>&lt;P&gt;Hi ,&lt;/P&gt;&lt;P&gt;I am looking for auto date fetching;&lt;/P&gt;&lt;P&gt;e.g start date='05feb2018'd&amp;nbsp;&lt;/P&gt;&lt;P&gt;i want to fetch auto date for every next month i.e. 5th day of every month should be the start date.&lt;/P&gt;&lt;P&gt;.eg. for next month when the program is auto run it should fetch the start date as 5th day of next month.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Similarly end date should be last day of every current month.&lt;/P&gt;&lt;P&gt;e.g end_date='28thfeb2018'd for feb ...for march it should&amp;nbsp;fetch the last date e.g. end_date='31March2018'.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Also let me know how can we code it in EG using the query builder.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Mon, 26 Feb 2018 05:11:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/auto-fetching-of-dates/m-p/440112#M109891</guid>
      <dc:creator>anirudhs</dc:creator>
      <dc:date>2018-02-26T05:11:13Z</dc:date>
    </item>
    <item>
      <title>Re: auto fetching of dates</title>
      <link>https://communities.sas.com/t5/SAS-Programming/auto-fetching-of-dates/m-p/440115#M109892</link>
      <description>&lt;P&gt;Use the date interval function&lt;STRONG&gt; intnx&lt;/STRONG&gt;:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
format startDate endDate yymmdd10.;
startDate = intnx("day",intnx("month", today(),0),4);
endDate = intnx("month", today(),0,"end");
run;

proc print data=want; run;




&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 26 Feb 2018 05:57:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/auto-fetching-of-dates/m-p/440115#M109892</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2018-02-26T05:57:57Z</dc:date>
    </item>
    <item>
      <title>Re: auto fetching of dates</title>
      <link>https://communities.sas.com/t5/SAS-Programming/auto-fetching-of-dates/m-p/440117#M109893</link>
      <description>Sorry for start date the month should be the next month.i.e. if end date=28feb2018 then start date should be 5march2018</description>
      <pubDate>Mon, 26 Feb 2018 06:18:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/auto-fetching-of-dates/m-p/440117#M109893</guid>
      <dc:creator>anirudhs</dc:creator>
      <dc:date>2018-02-26T06:18:02Z</dc:date>
    </item>
    <item>
      <title>Re: auto fetching of dates</title>
      <link>https://communities.sas.com/t5/SAS-Programming/auto-fetching-of-dates/m-p/440118#M109894</link>
      <description>&lt;P&gt;&lt;STRONG&gt;intnx&lt;/STRONG&gt; gives you all the flexibility. You should really look into it.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
format startDate endDate yymmdd10.;
startDate = intnx("day",intnx("month", today(),1),4);
endDate = intnx("month", today(),0,"end");
run;

proc print data=want; run;




&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 26 Feb 2018 06:20:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/auto-fetching-of-dates/m-p/440118#M109894</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2018-02-26T06:20:50Z</dc:date>
    </item>
    <item>
      <title>Re: auto fetching of dates</title>
      <link>https://communities.sas.com/t5/SAS-Programming/auto-fetching-of-dates/m-p/440119#M109895</link>
      <description>Thanks a lot for the code,&lt;BR /&gt;missed the simple understanding in hurry.</description>
      <pubDate>Mon, 26 Feb 2018 06:32:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/auto-fetching-of-dates/m-p/440119#M109895</guid>
      <dc:creator>anirudhs</dc:creator>
      <dc:date>2018-02-26T06:32:23Z</dc:date>
    </item>
  </channel>
</rss>

