MMDDYYw. Format

Writes date values in the form mmdd<yy>yy or mm/dd/<yy>yy, where a forward slash is the separator and the year appears as either 2 or 4 digits.

Category: Date and Time
Alignment: Right

Syntax

MMDDYYw.

Syntax Description

w

specifies the width of the output field.

Default 8
Range 2–10
Interaction When w has a value of from 2 to 5, the date appears with as much of the month and the day as possible. When w is 7, the date appears as a two-digit year without slashes.

Details

The MMDDYYw. format writes SAS date values in one of the following forms:
mmdd<yy>yy
mm/dd/<yy>yy:
where
mm
is an integer that represents the month.
/
is the separator.
dd
is an integer that represents the day of the month.
<yy>yy
is a two-digit or four-digit integer that represents the year.

Example

The following examples use the input value of 19291, which is the SAS date value that corresponds to October 25, 2012.
SAS Statement
Result
 
----+----1----+
put day mmddyy2.;
10
put day mmddyy3.; 
 10
put day mmddyy4.; 
1025
put day mmddyy5.;
10/25
put day mmddyy6.; 
102512
put day mmddyy7.;
 102512
put day mmddyy8.; 
10/25/12
put day mmddyy10.; 
10/25/2012

See Also

Functions:
DAY Function in SAS Functions and CALL Routines: Reference
MDY Function in SAS Functions and CALL Routines: Reference
MONTH Function in SAS Functions and CALL Routines: Reference
YEAR Function in SAS Functions and CALL Routines: Reference