Problem Note 34888: ANYDTDTE and ANYDTTME informats do not recognize values less than particular lengths
The ANYDTDTE. informat does not recognize a date in DDMMMYY format when the leading zero has been dropped, and the length of the string is less than seven characters. The DATEw. informat does still read this value correctly.
For example, the values "1MAR08" and "1MAR8" are not recognized by ANYDTDTE whereas "1MAR2008" is. All three of these values are recognized as 01MAR2008 by the DATEw. informat.
Likewise the ANYDTTME. informat has a similar issue. If the time value is less than five characters, a missing result occurs. For example, a time value of '1:40' has a width of four so the result is missing.
Operating System and Release Information
SAS System | Base SAS | z/OS | 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 64-bit Edition | 9.1 TS1M0 | 9.2 TS1M0 |
Microsoft Windows Server 2003 Enterprise 64-bit Edition | 9.1 TS1M0 | 9.2 TS1M0 |
Microsoft Windows 2000 Advanced Server | 9.1 TS1M0 | |
Microsoft Windows 2000 Datacenter Server | 9.1 TS1M0 | |
Microsoft Windows 2000 Server | 9.1 TS1M0 | |
Microsoft Windows 2000 Professional | 9.1 TS1M0 | |
Microsoft Windows NT Workstation | 9.1 TS1M0 | |
Microsoft Windows Server 2003 Datacenter Edition | 9.1 TS1M0 | 9.2 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 XP Professional | 9.1 TS1M0 | 9.2 TS1M0 |
64-bit Enabled AIX | 9.1 TS1M0 | 9.2 TS1M0 |
64-bit Enabled HP-UX | 9.1 TS1M0 | 9.2 TS1M0 |
64-bit Enabled Solaris | 9.1 TS1M0 | 9.2 TS1M0 |
HP-UX IPF | 9.1 TS1M0 | 9.2 TS1M0 |
Linux | 9.1 TS1M0 | 9.2 TS1M0 |
OpenVMS Alpha | 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.
The first DATA step demonstrates how ANYDTDTEw. informat doesn't read values correctly when the width of the value is less than 7 characters. The second step demonstrates how ANYDTTMEw. informat doesn't read time values less than 5 characters.
DATA _NULL_;
INFILE DATALINES MISSOVER;
INPUT D1 : ANYDTDTE9.;
INPUT D2 : DATE9.;
PUT D1= D1=DATE9.;
PUT D2= D2=DATE9.;
DATALINES;
1mar08
1mar08
1mar2008
1mar2008
run;
/* ANYDTTMEw. informat */
DATA B;
X='1:40';
y=INPUT(X,ANYDTTME.);
PUT Y=TIME5.;
RUN;
The results from the ANYDTDTE informat are as follows:
D1=. D1=.
D2=17592 D2=01MAR2008
D1=17592 D1=01MAR2008
D2=17592 D2=01MAR2008
The result from the ANYDTTME informat is as follows:
y=.
Type: | Problem Note |
Priority: | |
Topic: | SAS Reference ==> Informats ==> Date and Time ==> ANYDTDTE SAS Reference ==> Informats ==> Date and Time ==> ANYDTTME
|
Date Modified: | 2009-03-05 11:31:54 |
Date Created: | 2009-02-20 09:31:17 |