<?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 INTNX function in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/INTNX-function/m-p/18819#M3744</link>
    <description>I am trying to find a date 6 months prior to inputted date.  HOWEVER the final date should fall on a monday.  &lt;BR /&gt;
&lt;BR /&gt;
I run a report each monday &amp;amp; need to extract 6-months of data beginning on the monday closest to the 6 month point.  so it could be a little over/under 6mo of data.&lt;BR /&gt;
&lt;BR /&gt;
ex. this week i ran a report as of 11/16/09 &amp;amp; selected the begin date as 5/18/09 because its the closest Monday to (6-mon prior) Saturday 5/16.&lt;BR /&gt;
&lt;BR /&gt;
tried x=intnx('month','16nov2009'd,-6, "sameday"); but of course this will not automatically return a monday date.  Thought of combining this with a weekday function.&lt;BR /&gt;
&lt;BR /&gt;
is this possible?  any thoughts</description>
    <pubDate>Wed, 18 Nov 2009 14:03:15 GMT</pubDate>
    <dc:creator>Hart</dc:creator>
    <dc:date>2009-11-18T14:03:15Z</dc:date>
    <item>
      <title>INTNX function</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/INTNX-function/m-p/18819#M3744</link>
      <description>I am trying to find a date 6 months prior to inputted date.  HOWEVER the final date should fall on a monday.  &lt;BR /&gt;
&lt;BR /&gt;
I run a report each monday &amp;amp; need to extract 6-months of data beginning on the monday closest to the 6 month point.  so it could be a little over/under 6mo of data.&lt;BR /&gt;
&lt;BR /&gt;
ex. this week i ran a report as of 11/16/09 &amp;amp; selected the begin date as 5/18/09 because its the closest Monday to (6-mon prior) Saturday 5/16.&lt;BR /&gt;
&lt;BR /&gt;
tried x=intnx('month','16nov2009'd,-6, "sameday"); but of course this will not automatically return a monday date.  Thought of combining this with a weekday function.&lt;BR /&gt;
&lt;BR /&gt;
is this possible?  any thoughts</description>
      <pubDate>Wed, 18 Nov 2009 14:03:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/INTNX-function/m-p/18819#M3744</guid>
      <dc:creator>Hart</dc:creator>
      <dc:date>2009-11-18T14:03:15Z</dc:date>
    </item>
    <item>
      <title>Re: INTNX function</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/INTNX-function/m-p/18820#M3745</link>
      <description>How about using 26 weeks?  &lt;BR /&gt;
x=intnx('week.2','16nov2009'd,-26);</description>
      <pubDate>Wed, 18 Nov 2009 14:14:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/INTNX-function/m-p/18820#M3745</guid>
      <dc:creator>Flip</dc:creator>
      <dc:date>2009-11-18T14:14:13Z</dc:date>
    </item>
    <item>
      <title>Re: INTNX function</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/INTNX-function/m-p/18821#M3746</link>
      <description>ahhh yes!!! &lt;BR /&gt;
&lt;BR /&gt;
I tried like 7 different ways all but this!  thanks!!!</description>
      <pubDate>Wed, 18 Nov 2009 14:16:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/INTNX-function/m-p/18821#M3746</guid>
      <dc:creator>Hart</dc:creator>
      <dc:date>2009-11-18T14:16:52Z</dc:date>
    </item>
    <item>
      <title>Re: INTNX function</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/INTNX-function/m-p/18822#M3747</link>
      <description>A SAS numeric DATE variable is a count of the number of days since 1/1/1960.  So, yes, you can add/subtract either using an assignment statement and/or using the INTNX function.  My choice would be a combination of INTNX and using the WEEKDAY function, determine whether to add or subtract, since you mentioned the need for "closest" Monday.  Personally, I don't see how the sameday operand helps in your quest, though.&lt;BR /&gt;
&lt;BR /&gt;
Scott Barry&lt;BR /&gt;
SBBWorks, Inc.&lt;BR /&gt;
&lt;BR /&gt;
SAS Language Reference: Dictionary, Date and Time Intervals&lt;BR /&gt;
&lt;A href="http://support.sas.com/documentation/cdl/en/lrdict/62618/HTML/default/a003065889.htm#a003065892" target="_blank"&gt;http://support.sas.com/documentation/cdl/en/lrdict/62618/HTML/default/a003065889.htm#a003065892&lt;/A&gt;</description>
      <pubDate>Wed, 18 Nov 2009 14:19:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/INTNX-function/m-p/18822#M3747</guid>
      <dc:creator>sbb</dc:creator>
      <dc:date>2009-11-18T14:19:45Z</dc:date>
    </item>
    <item>
      <title>Re: INTNX function</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/INTNX-function/m-p/18823#M3748</link>
      <description>Sbb&lt;BR /&gt;
&lt;BR /&gt;
"sameday" isn't useful.  It was a left over experiment.  my mistake.  Thanks</description>
      <pubDate>Wed, 18 Nov 2009 14:28:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/INTNX-function/m-p/18823#M3748</guid>
      <dc:creator>Hart</dc:creator>
      <dc:date>2009-11-18T14:28:28Z</dc:date>
    </item>
    <item>
      <title>Re: INTNX function</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/INTNX-function/m-p/18824#M3749</link>
      <description>An easy thing that you could try is to use 26 weeks.  In intck, WEEK26.2 would get you 6 months starting on a Monday.  You'll have to test it with different starting dates to see if the equivalency is adequate to the business need.</description>
      <pubDate>Wed, 18 Nov 2009 17:07:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/INTNX-function/m-p/18824#M3749</guid>
      <dc:creator>Doc_Duke</dc:creator>
      <dc:date>2009-11-18T17:07:48Z</dc:date>
    </item>
  </channel>
</rss>

