<?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 calculate same date different month, SAS date in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/calculate-same-date-different-month-SAS-date/m-p/527918#M144018</link>
    <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;I need to calculate&amp;nbsp; SAS dates 3 month before and 3 month after given dates but not adding or subtracting 90 days&amp;nbsp;&lt;/P&gt;&lt;P&gt;For example,&lt;/P&gt;&lt;P&gt;I would like to know the dates (3 month before and after) using the given dates&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;3 month before&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;Given date&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;3 month after&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;10/1/2017&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;1/1/2017&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;4/1/2017&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;11/1/2017&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;2/1/2017&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;5/1/2017&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;12/1/2017&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;3/1/2017&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;6/1/2017&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Adding or subtracting 90 days do not give me the same dates with different months.&lt;/P&gt;&lt;P&gt;Does anyone know how to calculate these types of dates?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;</description>
    <pubDate>Thu, 17 Jan 2019 04:10:48 GMT</pubDate>
    <dc:creator>avepo</dc:creator>
    <dc:date>2019-01-17T04:10:48Z</dc:date>
    <item>
      <title>calculate same date different month, SAS date</title>
      <link>https://communities.sas.com/t5/SAS-Programming/calculate-same-date-different-month-SAS-date/m-p/527918#M144018</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;I need to calculate&amp;nbsp; SAS dates 3 month before and 3 month after given dates but not adding or subtracting 90 days&amp;nbsp;&lt;/P&gt;&lt;P&gt;For example,&lt;/P&gt;&lt;P&gt;I would like to know the dates (3 month before and after) using the given dates&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;3 month before&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;Given date&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;3 month after&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;10/1/2017&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;1/1/2017&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;4/1/2017&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;11/1/2017&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;2/1/2017&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;5/1/2017&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;12/1/2017&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;3/1/2017&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;6/1/2017&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Adding or subtracting 90 days do not give me the same dates with different months.&lt;/P&gt;&lt;P&gt;Does anyone know how to calculate these types of dates?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Thu, 17 Jan 2019 04:10:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/calculate-same-date-different-month-SAS-date/m-p/527918#M144018</guid>
      <dc:creator>avepo</dc:creator>
      <dc:date>2019-01-17T04:10:48Z</dc:date>
    </item>
    <item>
      <title>Re: calculate same date different month, SAS date</title>
      <link>https://communities.sas.com/t5/SAS-Programming/calculate-same-date-different-month-SAS-date/m-p/527919#M144019</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;

set have;

th3mthbfr=intnx('month', givrndate,-3,'s');

th3mthaftr=intnx('month', givrndate,3,'s');

format th3mthbfr th3mthaftr mmddyy10.;

run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;data want;&lt;/P&gt;
&lt;P&gt;set have;&lt;/P&gt;
&lt;P&gt;th3mthbfr=intnx('month', givrndate,-3);&lt;/P&gt;
&lt;P&gt;thrmthaftr=&lt;SPAN&gt;intnx('month', givrndate,3);&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;run;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 17 Jan 2019 04:26:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/calculate-same-date-different-month-SAS-date/m-p/527919#M144019</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2019-01-17T04:26:09Z</dc:date>
    </item>
    <item>
      <title>Re: calculate same date different month, SAS date</title>
      <link>https://communities.sas.com/t5/SAS-Programming/calculate-same-date-different-month-SAS-date/m-p/527920#M144020</link>
      <description>&lt;P&gt;Use the INTNX function:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;date_before = intnx("MONTH", date, -3, "SAME");
date_after = intnx("MONTH", date, 3, "SAME");


&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 17 Jan 2019 04:23:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/calculate-same-date-different-month-SAS-date/m-p/527920#M144020</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2019-01-17T04:23:28Z</dc:date>
    </item>
    <item>
      <title>Re: calculate same date different month, SAS date</title>
      <link>https://communities.sas.com/t5/SAS-Programming/calculate-same-date-different-month-SAS-date/m-p/527982#M144036</link>
      <description>&lt;P&gt;Thanks! It worked.&lt;/P&gt;</description>
      <pubDate>Thu, 17 Jan 2019 10:32:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/calculate-same-date-different-month-SAS-date/m-p/527982#M144036</guid>
      <dc:creator>avepo</dc:creator>
      <dc:date>2019-01-17T10:32:27Z</dc:date>
    </item>
  </channel>
</rss>

