Formats |
Category: | Date and Time |
Alignment: | right |
Syntax | |
Syntax Description | |
Details | |
Comparisons | |
Examples | |
See Also |
Syntax |
HHMMw.d |
specifies the width of the output field.
Default: | 5 |
Range: | 2-20 |
specifies the number of digits to the right of the decimal point in the minutes value. The digits to the right of the decimal point specify a fraction of a minute. This argument is optional.
Default: | 0 |
Range: | 0-19 |
Requirement: | must be less than w |
Details |
The HHMMw.d format writes SAS time values in the form hh:mm, where
Note: If hh is a single digit, HHMMw.d places a leading blank before the digit. For example, the HHMMw.d. format writes 9:00 instead of 09:00.
SAS rounds hours and minutes that are based on the value of seconds in a SAS time value.
The HHMM format uses asterisks to format values that are outside the time range 0-24 hours, such as datetime values.
Comparisons |
The HHMMw.d format is similar to the TIMEw.d format except that the HHMMw.d format does not print seconds.
The HHMMw.d format writes a leading blank for a single-hour digit. The TODw.d format writes a leading zero for a single-hour digit.
Examples |
The example table uses the input value of 46796, which is the SAS time value that corresponds to 12:59:56 p. m.
SAS Statement | Results |
---|---|
|
----+----1 |
put time hhmm.; |
13:00 |
put time hhmm8.2; |
12:59.93 |
In the first example, SAS rounds up the time value four seconds based on the value of seconds in the SAS time value. In the second example, by adding a decimal specification of 2 to the format shows that fifty-six seconds is 93% of a minute.
See Also |
| |||||||||||
| |||||||||||
|
Copyright © 2011 by SAS Institute Inc., Cary, NC, USA. All rights reserved.