Thursday, July 21, 2011

The HHMMSS Informat

The HHMMSS informat, new in SAS 9.3, reads time fields in hours, minutes, and seconds that do not contain punctuation. The data value can represent either a time of day or a duration. This informat is especially useful for fields that do not always contain minutes and seconds. These are examples of valid time of day fields for the HHMMSS informat:


With more than six digits in a field, the extra digits on the left are treated as part of the hours — useful if data values may go beyond 99 hours. The HHMMSS informat also reads fields that contain punctuation, and for these fields, it works the same as the TIME informat.

HHMMSS is the only new general-purpose informat in SAS 9.3. No new general-purpose formats were introduced. There are three new formats of note, which are for locale-based formatting of SAS datetime values including time zone.

The new documentation clarifies that 5-digit year numbers, though supported by some informats and formats, are considered an undocumented feature in SAS.

No comments:

Post a Comment