<?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: Fiscal Year in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Fiscal-Year/m-p/38506#M7732</link>
    <description>You will need to nest your two INTNX functions with the outer INTNX representing the "first Sunday" derivation logic (increment the date forward).&lt;BR /&gt;
&lt;BR /&gt;
Scott Barry&lt;BR /&gt;
SBBWorks, Inc.</description>
    <pubDate>Fri, 08 Jan 2010 18:52:43 GMT</pubDate>
    <dc:creator>sbb</dc:creator>
    <dc:date>2010-01-08T18:52:43Z</dc:date>
    <item>
      <title>Fiscal Year</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Fiscal-Year/m-p/38505#M7731</link>
      <description>I was using intnx('year.10', dt, 1)  to calculate our fiscal year starting in October.  I was just told that our fiscal year actually starts on the first Sunday in October, not October first.  &lt;BR /&gt;
&lt;BR /&gt;
I am not seeing a way to do this with the INTNX function alone.  Any ideas?&lt;BR /&gt;
&lt;BR /&gt;
I think I figured it out intnx('year.10', intnx('week.1', dt,0),1)&lt;BR /&gt;
&lt;BR /&gt;
    &lt;BR /&gt;
Message was edited by: Flip</description>
      <pubDate>Fri, 08 Jan 2010 16:45:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Fiscal-Year/m-p/38505#M7731</guid>
      <dc:creator>Flip</dc:creator>
      <dc:date>2010-01-08T16:45:06Z</dc:date>
    </item>
    <item>
      <title>Re: Fiscal Year</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Fiscal-Year/m-p/38506#M7732</link>
      <description>You will need to nest your two INTNX functions with the outer INTNX representing the "first Sunday" derivation logic (increment the date forward).&lt;BR /&gt;
&lt;BR /&gt;
Scott Barry&lt;BR /&gt;
SBBWorks, Inc.</description>
      <pubDate>Fri, 08 Jan 2010 18:52:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Fiscal-Year/m-p/38506#M7732</guid>
      <dc:creator>sbb</dc:creator>
      <dc:date>2010-01-08T18:52:43Z</dc:date>
    </item>
    <item>
      <title>Re: Fiscal Year</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Fiscal-Year/m-p/38507#M7733</link>
      <description>If I read you correctly you are part right.  I do need to change it to &lt;BR /&gt;
intnx('year.10', intnx('week.1', dt,1),1) since Sunday is the first day, but the week.1 must be inner.  Or maybe that is what you meant.</description>
      <pubDate>Fri, 08 Jan 2010 19:28:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Fiscal-Year/m-p/38507#M7733</guid>
      <dc:creator>Flip</dc:creator>
      <dc:date>2010-01-08T19:28:31Z</dc:date>
    </item>
    <item>
      <title>Re: Fiscal Year</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Fiscal-Year/m-p/38508#M7734</link>
      <description>Okay - so have you actually tried your suggested code - I did and got a week-day of Thursday, shown below.&lt;BR /&gt;
&lt;BR /&gt;
From what I understand, you want to advance the date to the next Sunday *AFTER* the first of a calendar month start-date.&lt;BR /&gt;
&lt;BR /&gt;
Scott Barry&lt;BR /&gt;
SBBWorks, Inc.&lt;BR /&gt;
&lt;BR /&gt;
52   data _null_;&lt;BR /&gt;
53   dt = mdy(9,23,2009);&lt;BR /&gt;
54   x = intnx('year.10', intnx('week.1', dt,1),1);&lt;BR /&gt;
55   format x dt date9.;&lt;BR /&gt;
56   put x= dt= x= downame3.;&lt;BR /&gt;
57   run;&lt;BR /&gt;
&lt;BR /&gt;
x=01OCT2009 dt=23SEP2009 x=Thu&lt;BR /&gt;
NOTE: DATA statement used (Total process time):

Message was edited by: sbb</description>
      <pubDate>Fri, 08 Jan 2010 20:51:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Fiscal-Year/m-p/38508#M7734</guid>
      <dc:creator>sbb</dc:creator>
      <dc:date>2010-01-08T20:51:45Z</dc:date>
    </item>
    <item>
      <title>Re: Fiscal Year</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Fiscal-Year/m-p/38509#M7735</link>
      <description>As Scott said: The OUTER intnx representing the first Sunday (and the inner October 1).&lt;BR /&gt;
&lt;BR /&gt;
This one works:&lt;BR /&gt;
 x = intnx('week',intnx('year.10',dt,1),1);</description>
      <pubDate>Fri, 08 Jan 2010 22:34:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Fiscal-Year/m-p/38509#M7735</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2010-01-08T22:34:16Z</dc:date>
    </item>
    <item>
      <title>Re: Fiscal Year</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Fiscal-Year/m-p/38510#M7736</link>
      <description>However, I would expect a given date would already be within the fiscal year/month which would mean that the inner INTNX would decrement, not increment.  Again, it would help if you ran the code for self-diagnosis and desk-checking - hopefully the sample code provided helps.&lt;BR /&gt;
&lt;BR /&gt;
Scott Barry&lt;BR /&gt;
SBBWorks, Inc.</description>
      <pubDate>Sat, 09 Jan 2010 02:40:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Fiscal-Year/m-p/38510#M7736</guid>
      <dc:creator>sbb</dc:creator>
      <dc:date>2010-01-09T02:40:39Z</dc:date>
    </item>
    <item>
      <title>Re: Fiscal Year</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Fiscal-Year/m-p/38511#M7737</link>
      <description>I discovered the underlying problem.  I was told the FY started the first Sunday in October, but they actually calculate it on a 5-4-4 calendar.  This means a table lookup is the only option.&lt;BR /&gt;
Luckily the date table they have is indexed so it works well.</description>
      <pubDate>Mon, 11 Jan 2010 14:17:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Fiscal-Year/m-p/38511#M7737</guid>
      <dc:creator>Flip</dc:creator>
      <dc:date>2010-01-11T14:17:25Z</dc:date>
    </item>
    <item>
      <title>Re: Fiscal Year</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Fiscal-Year/m-p/38512#M7738</link>
      <description>I work with clients who have a fiscal-year application and we use a PROC FORMAT to derive the following:&lt;BR /&gt;
&lt;BR /&gt;
- fiscal-year start date (maintained 5 years past and future for 3 years).&lt;BR /&gt;
- fiscal-year "period" - format: yyyy/pp, where "pp" could be 01 to 13 - a character var.&lt;BR /&gt;
- fiscal-year day-of-year (like Julian date but for the fiscal-year relevance).&lt;BR /&gt;
- fiscal-year week-of-year (like ISO week of year).&lt;BR /&gt;
&lt;BR /&gt;
You can create one format that returns each of the above values as a sub-field, parsed with the SCAN function.&lt;BR /&gt;
&lt;BR /&gt;
Scott Barry&lt;BR /&gt;
SBBWorks, Inc.&lt;BR /&gt;
&lt;BR /&gt;
Pertinent reference:&lt;BR /&gt;
&lt;A href="http://en.wikipedia.org/wiki/Fiscal_year" target="_blank"&gt;http://en.wikipedia.org/wiki/Fiscal_year&lt;/A&gt;</description>
      <pubDate>Mon, 11 Jan 2010 14:28:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Fiscal-Year/m-p/38512#M7738</guid>
      <dc:creator>sbb</dc:creator>
      <dc:date>2010-01-11T14:28:42Z</dc:date>
    </item>
    <item>
      <title>Re: Fiscal Year</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Fiscal-Year/m-p/38513#M7739</link>
      <description>Here they have a macro that does current plau 2 back.  My dates are bookings, so I need to go in the future.. I agree the format solution works well.  I am using:&lt;BR /&gt;
&lt;BR /&gt;
set mart.dt(keep = clndr_dt FY ) key = clndr_dt/unique;&lt;BR /&gt;
  if (not _iorc_%sysrc(_sok)) then do;&lt;BR /&gt;
     _error_ = 0;&lt;BR /&gt;
  end;&lt;BR /&gt;
&lt;BR /&gt;
which finds the FY quickly.</description>
      <pubDate>Mon, 11 Jan 2010 14:38:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Fiscal-Year/m-p/38513#M7739</guid>
      <dc:creator>Flip</dc:creator>
      <dc:date>2010-01-11T14:38:15Z</dc:date>
    </item>
  </channel>
</rss>

