Problem Note 35412: ANYDTDTM informat reads datetime values as dates
When reading datetime values with PROC IMPORT or the Import Wizard, often the ANYDTDTM informat is used since it can read many different styles of datetime values. When a value that is ambiguous is read, SAS may read the datetime value as a date only. This results in different results than the coder anticipated.
A sample value is 1/1/09 1:15. The three values could be month, day, or year values on a calendar. When this occurs, the DATESTYLE= system option value is used to determine which order to assume the month, day, and year values to be ordered.
A workaround for this type of value is to specify the MDYAMPM informat for reading the above value.
The following code also reproduces a known issue where ANYDTDTM informat doesn't know how to read the given value. Instead of returning a missing value, a crash can occur.
data _null_;
x=input("31000.55SHP002",anydtdtm14.);
put x=;
run;
Operating System and Release Information
SAS System | Base SAS | z/OS | 9.2 TS1M0 | 9.2 TS2M0 |
Microsoft® Windows® for 64-Bit Itanium-based Systems | 9.2 TS1M0 | 9.2 TS2M0 |
Microsoft Windows Server 2003 Datacenter 64-bit Edition | 9.2 TS1M0 | 9.2 TS2M0 |
Microsoft Windows Server 2003 Enterprise 64-bit Edition | 9.2 TS1M0 | 9.2 TS2M0 |
Microsoft Windows XP 64-bit Edition | 9.2 TS1M0 | 9.2 TS2M0 |
Microsoft® Windows® for x64 | 9.2 TS1M0 | 9.2 TS2M0 |
Microsoft Windows Server 2003 Datacenter Edition | 9.2 TS1M0 | 9.2 TS2M0 |
Microsoft Windows Server 2003 Enterprise Edition | 9.2 TS1M0 | 9.2 TS2M0 |
Microsoft Windows Server 2003 Standard Edition | 9.2 TS1M0 | 9.2 TS2M0 |
Microsoft Windows XP Professional | 9.2 TS1M0 | 9.2 TS2M0 |
Windows Vista | 9.2 TS1M0 | 9.2 TS2M0 |
64-bit Enabled AIX | 9.2 TS1M0 | 9.2 TS2M0 |
64-bit Enabled HP-UX | 9.2 TS1M0 | 9.2 TS2M0 |
64-bit Enabled Solaris | 9.2 TS1M0 | 9.2 TS2M0 |
HP-UX IPF | 9.2 TS1M0 | 9.2 TS2M0 |
Linux | 9.2 TS1M0 | 9.2 TS2M0 |
Linux for x64 | 9.2 TS1M0 | 9.2 TS2M0 |
OpenVMS on HP Integrity | 9.2 TS1M0 | 9.2 TS2M0 |
Solaris for x64 | 9.2 TS1M0 | 9.2 TS2M0 |
*
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: | |
Topic: | Common Programming Tasks ==> Reading and Writing External Data Common Programming Tasks ==> Reading and Writing External Data ==> with PROC IMPORT SAS Reference ==> Informats ==> Date and Time ==> ANYDTDTM
|
Date Modified: | 2009-04-03 13:27:28 |
Date Created: | 2009-04-01 11:06:33 |