SUPPORT / SAMPLES & SAS NOTES
 

Support

Problem Note 68071: The ANYDTDTMw. informat does not read a datetime value with trailing characters correctly in the SAS® 9.4M4 (TS1M4) release and in later releases

DetailsCodeOutputHotfixAboutRate It

Beginning with the SAS 9.4M4 maintenance release, using the ANYDTDTMw. informat to read a datetime value with character data at the end will return a missing value. Here are some examples of datetime values with character data at the end:

2020-11-12 02:22:56.26 UTC
2021-11-12 02:22:56.26 GMT
2021-6-10 12:20:30 America/Los_Angeles

The SAS® log does not indicate a problem with any INVALID DATA message, and the value will be missing. Datetime values with character data at the end like 2020-11-12 02:22:56.26 UTC are not supported by the ANYDT* informats. Beginning with the SAS® 9.4M8 (TS1M8) maintenance release, an INVALID DATA message will be produced in the SAS log to indicate that the value is not valid and the value will be missing.  

A workaround is to read the datetime value as a character variable, use a function like the COMPRESS function to remove the character data, and then use the INPUT function with the ANYDTDTMw. informat to convert to a SAS datetime value. 

Example code for this workaround is on the Full Code tab.

The output for the workaround code is on the Output tab.

Click the Hot Fix tab in this note to access the hot fix for this issue.

Note: An updated hot fix for this issue was provided on March 4, 2022. If you applied the hot fix from this note before March 4, click the Hot Fix tab again to access the updated hot fix.

After you apply the hot fix, an INVALID DATA message appears in the log for the SAS® 9.4M7 (TS1M7) release.

The hot fix applies to all three of the ANYDT* family of informats:

  • ANYDTDTE
  • ANYDTTME
  • ANYDTDTM


Operating System and Release Information

Product FamilyProductSystemProduct ReleaseSAS Release
ReportedFixed*ReportedFixed*
SAS SystemBase SASz/OS9.4_M49.4 TS1M4
z/OS 64-bit9.4_M49.4 TS1M4
Microsoft® Windows® for x649.4_M49.4 TS1M4
Microsoft Windows 8 Enterprise 32-bit9.4_M49.4 TS1M4
Microsoft Windows 8 Enterprise x649.4_M49.4 TS1M4
Microsoft Windows 8 Pro 32-bit9.4_M49.4 TS1M4
Microsoft Windows 8 Pro x649.4_M49.4 TS1M4
Microsoft Windows 8.1 Enterprise 32-bit9.4_M49.4 TS1M4
Microsoft Windows 8.1 Enterprise x649.4_M49.4 TS1M4
Microsoft Windows 8.1 Pro 32-bit9.4_M49.4 TS1M4
Microsoft Windows 8.1 Pro x649.4_M49.4 TS1M4
Microsoft Windows 109.4_M49.4 TS1M4
Microsoft Windows Server 20089.4_M49.4 TS1M4
Microsoft Windows Server 2008 R29.4_M49.4 TS1M4
Microsoft Windows Server 2008 for x649.4_M49.4 TS1M4
Microsoft Windows Server 2012 Datacenter9.4_M49.4 TS1M4
Microsoft Windows Server 2012 R2 Datacenter9.4_M49.4 TS1M4
Microsoft Windows Server 2012 R2 Std9.4_M49.4 TS1M4
Microsoft Windows Server 2012 Std9.4_M49.4 TS1M4
Windows 7 Enterprise 32 bit9.4_M49.4 TS1M4
Windows 7 Enterprise x649.4_M49.4 TS1M4
Windows 7 Home Premium 32 bit9.4_M49.4 TS1M4
Windows 7 Home Premium x649.4_M49.4 TS1M4
Windows 7 Professional 32 bit9.4_M49.4 TS1M4
Windows 7 Professional x649.4_M49.4 TS1M4
Windows 7 Ultimate 32 bit9.4_M49.4 TS1M4
Windows 7 Ultimate x649.4_M49.4 TS1M4
64-bit Enabled AIX9.4_M49.4 TS1M4
64-bit Enabled Solaris9.4_M49.4 TS1M4
HP-UX IPF9.4_M49.4 TS1M4
Linux for x649.4_M49.4 TS1M4
Solaris for x649.4_M49.4 TS1M4
* 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.