Writes datetime values in the form
ddmmmyy:hh:mm:ss.ss.
Category: |
Date and Time
|
Alignment: |
right
|
-
w
-
specifies the width of the output field.
Default: |
16 |
Range: |
7-40 |
Tip: |
SAS requires a minimum w value of 16 to write a SAS datetime value with the date,
hour, and seconds. Add an additional two places to w
and a value to d to return values with optional
decimal fractions of seconds. |
-
d
-
specifies the number of digits to the right
of the decimal point in the seconds value. This argument is optional.
Requirement: |
must be less than w |
Range: |
0-39 |
Note: If
w-d< 17, SAS truncates the decimal values.
The DATETIMEw.d format writes SAS datetime values in the form
ddmmmyy:hh:mm:ss.ss, where
-
dd
-
is an integer that represents the day of
the month.
-
mmm
-
is the first three letters of the month
name.
-
yy
-
is a two-digit integer that represents the
year.
-
hh
-
is an integer that represents the hour in
24-hour clock time.
-
mm
-
is an integer that represents the minutes.
-
ss.ss
-
is the number of seconds to two decimal
places.
The example table uses the input value of 1447213759,
which is the SAS datetime value that corresponds to 3:49:19 a.m. on
November 10, 2005.
SAS Statement |
Results |
|
----+----1----+----2
|
put event datetime.;
|
10NOV05:03:49:19
|
put event datetime7.;
|
10NOV05
|
put event datetime12.;
|
10NOV05:03
|
put event datetime18.;
|
10NOV05:03:49:19
|
put event datetime18.1;
|
10NOV05:03:49:19.0
|
put event datetime19.;
|
10NOV2005:03:49:19
|
put event datetime20.1;
|
10NOV2005:03:49:19.0
|
put event datetime21.2;
|
10NOV2005:03:49:19.00
|
|
Formats:
|
|
Function:
|
|
Informats:
|
Copyright © 2011 by SAS Institute Inc., Cary, NC, USA. All rights reserved.