Problem Note 46142: ANYDTDTM informat does not read YYYYMMDD:HH:MM:SS correctly
When a value in the form of YYYYMMDD:HH:MM:SS is read into SAS with the ANYDTDTMw. informat, some values are not read and stored properly. If the month value is a single digit, the input is misinterpreted and the resulting datetime value is incorrect.
Operating System and Release Information
SAS System | Base SAS | z/OS | 9.2 TS1M0 | 9.3 TS1M2 |
Microsoft® Windows® for 64-Bit Itanium-based Systems | 9.2 TS1M0 | 9.3 TS1M2 |
Microsoft Windows Server 2003 Datacenter 64-bit Edition | 9.2 TS1M0 | 9.3 TS1M2 |
Microsoft Windows Server 2003 Enterprise 64-bit Edition | 9.2 TS1M0 | 9.3 TS1M2 |
Microsoft Windows XP 64-bit Edition | 9.2 TS1M0 | 9.3 TS1M2 |
Microsoft® Windows® for x64 | 9.2 TS1M0 | 9.3 TS1M2 |
Microsoft Windows Server 2003 Datacenter Edition | 9.2 TS1M0 | 9.3 TS1M2 |
Microsoft Windows Server 2003 Enterprise Edition | 9.2 TS1M0 | 9.3 TS1M2 |
Microsoft Windows Server 2003 Standard Edition | 9.2 TS1M0 | 9.3 TS1M2 |
Microsoft Windows XP Professional | 9.2 TS1M0 | 9.3 TS1M2 |
Windows Vista | 9.2 TS1M0 | 9.3 TS1M2 |
Windows Vista for x64 | 9.2 TS1M0 | 9.3 TS1M2 |
64-bit Enabled AIX | 9.2 TS1M0 | 9.3 TS1M2 |
64-bit Enabled HP-UX | 9.2 TS1M0 | 9.3 TS1M2 |
64-bit Enabled Solaris | 9.2 TS1M0 | 9.3 TS1M2 |
HP-UX IPF | 9.2 TS1M0 | 9.3 TS1M2 |
Linux | 9.2 TS1M0 | 9.3 TS1M2 |
Linux for x64 | 9.2 TS1M0 | 9.3 TS1M2 |
OpenVMS on HP Integrity | 9.2 TS1M0 | 9.3 TS1M2 |
Solaris for x64 | 9.2 TS1M0 | 9.3 TS1M2 |
*
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.
When the month value is a single digit and the date portion of the datetime does not have delimiters, the value is not read correctly.
data test;
infile datalines;
input dtm anydtdtm19.;
format dtm datetime19.;
datalines;
20111105:20:31:55
20110105:20:31:55
;
proc print;
run;
/* The first observation is correct but the second observation is not */
Obs dtm
1 05NOV2011:20:31:55
2 01NOV1920:20:31:55
When the month value is a single digit and there are no delimiters between the date components, the date portion is not read correctly.
Type: | Problem Note |
Priority: | medium |
Topic: | SAS Reference ==> Informats ==> Date and Time ==> ANYDTDTM
|
Date Modified: | 2012-04-04 10:09:41 |
Date Created: | 2012-03-27 08:39:56 |