<?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 Function - How can I get the six month previous and 6 month next date from a date. in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Date-Function-How-can-I-get-the-six-month-previous-and-6-month/m-p/502641#M134207</link>
    <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data Set_A;
input Migration_Date:date7.;
format Migration_Date date7.;
datalines;
1-Oct-10
1-Jun-10
1-Apr-11
1-Oct-10
1-Nov-10
1-Jun-10
1-Oct-10
1-Jan-14
1-Mar-11
;

data want;
   set Set_A;

   /* Exactly six months back */
   sixmonth_backdt=intnx('month',Migration_Date,-6,'S');

   /* Six months back, start of month */
   sixmonth_backdt_b=intnx('month',Migration_Date,-6,'B');

   /* The day before */
   The_Day_Before=Migration_Date-1;

   format _numeric_ date7.;

run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Tue, 09 Oct 2018 10:32:27 GMT</pubDate>
    <dc:creator>PeterClemmensen</dc:creator>
    <dc:date>2018-10-09T10:32:27Z</dc:date>
    <item>
      <title>Date Function - How can I get the six month previous and 6 month next date from a date.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Date-Function-How-can-I-get-the-six-month-previous-and-6-month/m-p/502635#M134206</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please help me to get the 6 month next date and previous date from the below dates.&amp;nbsp; Also suggest me where I am mistaking?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;Set-A&lt;/P&gt;&lt;P&gt;Migration_Date&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;1-Oct-10&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;1-Jun-10&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;1-Apr-11&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;1-Oct-10&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;1-Nov-10&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;1-Jun-10&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;1-Oct-10&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;1-Jan-14&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;1-Mar-11&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data date_treat;&lt;BR /&gt;set A;&lt;BR /&gt;sixmonth_backdt=intnx('month','Migration_dt'd,-6,'B');&lt;BR /&gt;format sixmonth_backdt date9.;&lt;BR /&gt;run;&lt;/P&gt;</description>
      <pubDate>Tue, 09 Oct 2018 10:19:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Date-Function-How-can-I-get-the-six-month-previous-and-6-month/m-p/502635#M134206</guid>
      <dc:creator>vishalrajpoot3</dc:creator>
      <dc:date>2018-10-09T10:19:42Z</dc:date>
    </item>
    <item>
      <title>Re: Date Function - How can I get the six month previous and 6 month next date from a date.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Date-Function-How-can-I-get-the-six-month-previous-and-6-month/m-p/502641#M134207</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data Set_A;
input Migration_Date:date7.;
format Migration_Date date7.;
datalines;
1-Oct-10
1-Jun-10
1-Apr-11
1-Oct-10
1-Nov-10
1-Jun-10
1-Oct-10
1-Jan-14
1-Mar-11
;

data want;
   set Set_A;

   /* Exactly six months back */
   sixmonth_backdt=intnx('month',Migration_Date,-6,'S');

   /* Six months back, start of month */
   sixmonth_backdt_b=intnx('month',Migration_Date,-6,'B');

   /* The day before */
   The_Day_Before=Migration_Date-1;

   format _numeric_ date7.;

run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 09 Oct 2018 10:32:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Date-Function-How-can-I-get-the-six-month-previous-and-6-month/m-p/502641#M134207</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2018-10-09T10:32:27Z</dc:date>
    </item>
  </channel>
</rss>

