MONTHw. Format

Writes date values as the month of the year.
Category: Date and Time
Alignment: right

Syntax

MONTHw.

Syntax Description

w
specifies the width of the output field.
Default:2
Range:1–32
Tip:Use MONTH1. to obtain a hexadecimal value.

Details

The MONTHw. format writes the month (1 through 12) of the year from a SAS date value. If the month is a single digit, the MONTHw. format places a leading blank before the digit. For example, the MONTHw. format writes 4 instead of 04.

Example

The example table uses the input value of 19127, which is the SAS date value that corresponds to May 14, 2012.
SAS Statement
Result
 
----+----1
put date month.;
 5

See Also

Formats: