Problem Note 37806: YMDDTTM informat does not handle blank input field properly
When the input field to the YMDDTTMw.d informat is blank, such that the return value should be missing, it is not handling that properly.
See the Full Code tab, and in the Results tab notice the BOTH_PARTS variable for observations 1,3, and 5. The values should be missing but are not.
Operating System and Release Information
SAS System | Base SAS | z/OS | 9 TS M0 | 9.2 TS2M3 |
Microsoft® Windows® for 64-Bit Itanium-based Systems | 9 TS M0 | 9.2 TS2M3 |
Microsoft Windows Server 2003 Datacenter 64-bit Edition | 9 TS M0 | 9.2 TS2M3 |
Microsoft Windows Server 2003 Enterprise 64-bit Edition | 9 TS M0 | 9.2 TS2M3 |
Microsoft Windows 2000 Advanced Server | 9 TS M0 | |
Microsoft Windows 2000 Datacenter Server | 9 TS M0 | |
Microsoft Windows 2000 Server | 9 TS M0 | |
Microsoft Windows 2000 Professional | 9 TS M0 | |
Microsoft Windows NT Workstation | 9 TS M0 | |
Microsoft Windows Server 2003 Datacenter Edition | 9 TS M0 | 9.2 TS2M3 |
Microsoft Windows Server 2003 Enterprise Edition | 9 TS M0 | 9.2 TS2M3 |
Microsoft Windows Server 2003 Standard Edition | 9 TS M0 | 9.2 TS2M3 |
Microsoft Windows XP Professional | 9 TS M0 | 9.2 TS2M3 |
64-bit Enabled AIX | 9 TS M0 | 9.2 TS2M3 |
64-bit Enabled HP-UX | 9 TS M0 | 9.2 TS2M3 |
64-bit Enabled Solaris | 9 TS M0 | 9.2 TS2M3 |
HP-UX IPF | 9 TS M0 | 9.2 TS2M3 |
Linux | 9 TS M0 | 9.2 TS2M3 |
OpenVMS Alpha | 9 TS M0 | 9.2 TS2M3 |
Tru64 UNIX | 9 TS M0 | 9.2 TS2M3 |
*
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 LDT field is missing for observations 1, 3, and 5; however, the variable BOTH_PARTS doesn't have a missing value for those observations as you'd expect.
data test;
infile datalines truncover;
input sub $ ldt $20.;
datalines;
A
A 2009-11-11:12:15
B
B 2009-12-13:15:16
C
;
run;
data lb;
set test;
input_only = input(ldt, ymddttm.);
if input_only ne . then dpart_only = datepart(input_only);
both_parts = datepart(input(ldt, ymddttm.));
format input_only datetime20. dpart_only both_parts yymmdd10. ;
proc print;
run;
/* Notice BOTH_PARTS should have missing values for observations 1,3,5 but doesn't */
sub ldt input_only dpart_only both_parts
A . . 1960-01-01
A 2009-11-11:12:15 11NOV2009:12:15:00 2009-11-11 2009-11-11
B . . 2009-11-11
B 2009-12-13:15:16 13DEC2009:15:16:00 2009-12-13 2009-12-13
C . . 2009-12-13
Type: | Problem Note |
Priority: | high |
Topic: | SAS Reference ==> Informats ==> Date and Time
|
Date Modified: | 2009-12-03 10:35:56 |
Date Created: | 2009-11-12 09:50:51 |