Problem Note 16184: The INTNX function with SAMEDAY alignment does not support multiple, shifted time, or datetime intervals
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
SAS System | Base SAS | Microsoft Windows XP Professional | 9.1 TS1M0 | 9.2 TS1M0 |
Microsoft Windows NT Workstation | 9.1 TS1M0 | |
Microsoft Windows Server 2003 Enterprise Edition | 9.1 TS1M0 | 9.2 TS1M0 |
Microsoft Windows Server 2003 Standard Edition | 9.1 TS1M0 | 9.2 TS1M0 |
Microsoft® Windows® for 64-Bit Itanium-based Systems | 9.1 TS1M0 | 9.2 TS1M0 |
Microsoft Windows Server 2003 Datacenter Edition | 9.1 TS1M0 | 9.2 TS1M0 |
Microsoft Windows 2000 Professional | 9.1 TS1M0 | 9.2 TS1M0 |
Microsoft Windows 2000 Server | 9.1 TS1M0 | 9.2 TS1M0 |
Microsoft Windows 2000 Datacenter Server | 9.1 TS1M0 | 9.2 TS1M0 |
z/OS | 9.1 TS1M0 | 9.2 TS1M0 |
Microsoft Windows 2000 Advanced Server | 9.1 TS1M0 | 9.2 TS1M0 |
64-bit Enabled Solaris | 9.1 TS1M0 | 9.2 TS1M0 |
Linux | 9.1 TS1M0 | 9.2 TS1M0 |
HP-UX IPF | 9.1 TS1M0 | 9.2 TS1M0 |
64-bit Enabled HP-UX | 9.1 TS1M0 | 9.2 TS1M0 |
OpenVMS Alpha | 9.1 TS1M0 | 9.2 TS1M0 |
64-bit Enabled AIX | 9.1 TS1M0 | 9.2 TS1M0 |
Tru64 UNIX | 9.1 TS1M0 | 9.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.
Type: | Problem Note |
Priority: | high |
Topic: | SAS Reference ==> Functions
|
Date Modified: | 2006-04-14 10:57:05 |
Date Created: | 2005-09-19 11:18:43 |