<?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 Working with SAS format dates in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Working-with-SAS-format-dates/m-p/160904#M263328</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have all my info about dates in SAS format and I want from each date subtract nine months.&lt;/P&gt;&lt;P&gt;Is it possible to do?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 14 Aug 2014 07:33:18 GMT</pubDate>
    <dc:creator>viollete</dc:creator>
    <dc:date>2014-08-14T07:33:18Z</dc:date>
    <item>
      <title>Working with SAS format dates</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Working-with-SAS-format-dates/m-p/160904#M263328</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have all my info about dates in SAS format and I want from each date subtract nine months.&lt;/P&gt;&lt;P&gt;Is it possible to do?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 14 Aug 2014 07:33:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Working-with-SAS-format-dates/m-p/160904#M263328</guid>
      <dc:creator>viollete</dc:creator>
      <dc:date>2014-08-14T07:33:18Z</dc:date>
    </item>
    <item>
      <title>Re: Working with SAS format dates</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Working-with-SAS-format-dates/m-p/160905#M263329</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;intnx()&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 14 Aug 2014 08:02:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Working-with-SAS-format-dates/m-p/160905#M263329</guid>
      <dc:creator>LinusH</dc:creator>
      <dc:date>2014-08-14T08:02:52Z</dc:date>
    </item>
    <item>
      <title>Re: Working with SAS format dates</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Working-with-SAS-format-dates/m-p/160906#M263330</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Linus' reply is a bit terse.&amp;nbsp; The intnx function will provide an answer, provided you supply the right question.&amp;nbsp; Do you want 9 calendar months exactly (ie to the same day - if possible - 9 months previously), or do you just need the month and the first day will do; or maybe push all dates &lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;back &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;by the same amount (0.75 year = 274 days)?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;Taking these options in reverse order:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;Prev_date = date - 274 ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;Prev_date = intnx("MONTH", date, -9) ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;Prev_date = intnx("MONTH", date, -9, "SAME") ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;INTNX is documented here &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;&lt;A href="http://support.sas.com/documentation/cdl/en/lrdict/64316/HTML/default/viewer.htm#a000212700.htm" title="http://support.sas.com/documentation/cdl/en/lrdict/64316/HTML/default/viewer.htm#a000212700.htm"&gt;SAS(R) 9.2 Language Reference: Dictionary, Fourth Edition&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;BTW, if your dates are datetime intervals you need to use "DTMONTH" instead of "MONTH" ; and for the 274 day calculations use&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;Prev_date = intnx("DTDAY", date, -274, "SAME") ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;Richard&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 14 Aug 2014 12:38:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Working-with-SAS-format-dates/m-p/160906#M263330</guid>
      <dc:creator>RichardinOz</dc:creator>
      <dc:date>2014-08-14T12:38:49Z</dc:date>
    </item>
  </channel>
</rss>

