Previous Page | Next Page

Formats

HOURw.d Format



Writes time values as hours and decimal fractions of hours.
Category: Date and Time
Alignment: right

Syntax
Syntax Description
Details
Examples
See Also

Syntax

HOURw.d

Syntax Description

w

specifies the width of the output field.

Default: 2
Range: 2-20
d

specifies the number of digits to the right of the decimal point in the hour value. Therefore, SAS prints decimal fractions of the hour. This argument is optional.

Requirement: must be less than w
Range: 0-19

Details

SAS rounds hours based on the value of minutes in the SAS time value.

The HOUR format uses asterisks to format values that are outside the time range 0-24 hours, such as datetime values.


Examples

The example table uses the input value of 41400, which is the SAS time value that corresponds to 11:30 a.m.

SAS Statement Results
 
----+----1
put time hour4.1;
11.5


See Also

Formats:

HHMMw.d Format

MMSSw.d Format

TIMEw.d Format

TODw.d Format

Functions:

HMS Function

HOUR Function

MINUTE Function

SECOND Function

TIME Function

Informat:

TIMEw. Informat

Previous Page | Next Page | Top of Page