BookmarkSubscribeRSS Feed
🔒 This topic is locked. We are no longer accepting replies to this topic. Need further help? Please sign in and ask a new question.
SAS_Tipster
Moderator

The INTNX function takes a supplied date, time, or datetime value and can shift it by any specified alignment you choose. For example, if you need to know the first day of the current calendar year, you can use the following formula:

 

intnx('YEAR', today(), 0, 'B')

But what if you need to know the beginning of an odd year format, such as the Federal Fiscal Year? The federal fiscal year starts October 1 and runs through September 30. For example, FFY2010 is October 1, 2009 through September 30, 2010. The optional shift-index portion of the interval argument can shift the interval to start at a specified subperiod starting point. For example, 'YEAR.10' specifies yearly periods shifted to start on the first of October of each calendar year and to end in September of the following year. In other words, to find the first day of the current Federal Fiscal Year, you would use:

 

intnx('YEAR.10', today(), 0, 'B')

Thanks to Tasha Chapman for sharing this tip on sasCommunity.org.

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

Visit a random SAS tip This SAS Tips board is not open for replies or comments, but we welcome your feedback and questions. Have a question or comment about this tip? Start a new topic in one of our discussion boards, and reference this tip topic.
Discussion stats
  • 0 replies
  • 3298 views
  • 0 likes
  • 1 in conversation