SUPPORT / SAMPLES & SAS NOTES
 

Support

Problem Note 16184: The INTNX function with SAMEDAY alignment does not support multiple, shifted time, or datetime intervals

DetailsHotfixAboutRate It

The SAMEDAY alignment, first implemented in SAS® 9.1, supports only single, non-shifted date intervals. If other intervals are specified, no error or warning is generated and INTNX might return incorrect results. If the interval specified is a datetime, the time portion of the datetime result returned by INTNX may be midnight, even if the time portion of the "start-from" datetime value is not midnight. If a multiple or shifted interval is specified, the SAMEDAY alignment may also return incorrect results. For example, prior to SAS 9.2.:

data _null_; date='01mar1999'd; new=intnx('month12',date,1,'SAMEDAY'); put new= date9.; run;

produces:

new=29FEB2000
In SAS 9.2, the same code produces:
new=01MAR2000

Beginning in SAS 9.2 the SAMEDAY alignment supports multiple, shifted, time, and datetime intervals. The value returned is aligned with respect to the shift period for the interval specified. Intervals' shift periods are documented in the "About Date and Time Intervals" section of the Dates, Times and Intervals chapter of the SAS Language Reference: Concepts. In the example above, since the shift period for the MONTH12 interval is MONTH, the result is aligned with respect to the month of the "start-from" date.

Select the Hot Fix tab in this note to access the hot fix for this issue.

This fix contains a new function called TINTNX which implements the new (9.2) behavior:

data _null_; date='01mar1999'd; new=TINTNX('month12',date,1,'SAMEDAY'); put new= date9.; run; new=01MAR2000


Operating System and Release Information

Product FamilyProductSystemSAS Release
ReportedFixed*
SAS SystemBase SASMicrosoft Windows XP Professional9.1 TS1M09.2 TS1M0
Microsoft Windows NT Workstation9.1 TS1M0
Microsoft Windows Server 2003 Enterprise Edition9.1 TS1M09.2 TS1M0
Microsoft Windows Server 2003 Standard Edition9.1 TS1M09.2 TS1M0
Microsoft® Windows® for 64-Bit Itanium-based Systems9.1 TS1M09.2 TS1M0
Microsoft Windows Server 2003 Datacenter Edition9.1 TS1M09.2 TS1M0
Microsoft Windows 2000 Professional9.1 TS1M09.2 TS1M0
Microsoft Windows 2000 Server9.1 TS1M09.2 TS1M0
Microsoft Windows 2000 Datacenter Server9.1 TS1M09.2 TS1M0
z/OS9.1 TS1M09.2 TS1M0
Microsoft Windows 2000 Advanced Server9.1 TS1M09.2 TS1M0
64-bit Enabled Solaris9.1 TS1M09.2 TS1M0
Linux9.1 TS1M09.2 TS1M0
HP-UX IPF9.1 TS1M09.2 TS1M0
64-bit Enabled HP-UX9.1 TS1M09.2 TS1M0
OpenVMS Alpha9.1 TS1M09.2 TS1M0
64-bit Enabled AIX9.1 TS1M09.2 TS1M0
Tru64 UNIX9.1 TS1M09.2 TS1M0
* For software releases that are not yet generally available, the Fixed Release is the software release in which the problem is planned to be fixed.