Writes SAS time values and the time portion of SAS datetime values
in the form hh:mm:ss.ss.
Category: |
Date and Time
|
Alignment: |
right
|
-
w
-
specifies the width of the output field.
Default: |
8 |
Range: |
2-20 |
Tip: |
SAS writes a zero for a zero hour if the
specified width is sufficient. For example, 02:30 or 00:30. |
-
d
-
specifies the number of digits to the right
of the decimal point in the seconds value. This argument is optional.
Default: |
0 |
Range: |
0-19 |
Requirement: |
must be less than
w |
The TODw.d format writes SAS time and datetime values in
the form hh:mm:ss.ss, where
-
hh
-
is an integer that represents the hour.
-
mm
-
is an integer that represents the minutes.
-
ss.ss
-
is the number of seconds to two decimal
places.
The TODw.d format writes
a leading zero for a single-hour digit. The TIMEw.d
format and the HHMMw.d format write a leading
blank for a single-hour digit.
In the following example, the SAS datetime value 1566742823 corresponds
to August 24, 2009 at 2:20:23 p.m.
SAS Statement |
Results |
|
----+----1
|
begin = '1:30't;
put begin tod5.;
|
01:30
|
begin = 1566742823;
put begin tod9.;
|
14:20:23
|
|
Formats:
|
|
Function:
|
|
Informat:
|
Copyright © 2011 by SAS Institute Inc., Cary, NC, USA. All rights reserved.