The ANYDTDTM informat
reads data that is in the form of any of the following informats or
date/time forms, and extracts the datetime part from the derived value:
Informat or Form of
Input
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1x is a special character that separates the month from the year. <YY>
indicates the century is optional.
|
2IF AM | PM is not present
and the month and day values are ambiguous, the value for the DATESTYLE=
system option is used to determine the order.
|
If the input value is
a time-only value, then SAS assumes a date of 01JAN1960. If the input
value is a date-only value , then SAS assumes a time of 12:00 midnight.
Input time values must include hours and minutes. If any part of a
date in the input value is missing in the input value, or if the hour
and minutes in a time value are missing or out of range, then the
value read is a SAS missing value.
The input values for
the preceding informats are mutually exclusive except for MMDDYY,
DDMMYY, or YYMMDD when two-digit years are used. It is possible for
input data such as 01-02-03 or 01-02 to be ambiguous with respect
to the month, day, and year. In this case, the DATESTYLE system option
indicates the order of the month, day, and year.
The ANYDTTME informat
uses the following rules when reading colons and periods in time values:
Use of Colons and Periods
|
|
a single colon in the
value h: m indicates hours and minutes
|
|
two colons in the value
h:m:s indicate hours, minutes, and seconds
|
|
a single period in the
value m:s.ff, where ff is a fraction of a second, indicates that the
number preceding the period is the number of seconds
|
|
multiple periods in
the value indicate that the period is a delimiter for dates and the
value is not a time value.
|
|