DATEw. Format

Writes SAS date values in the form ddmmmyy, ddmmmyyyy, or dd-mmm-yyyy.

Category: Date and Time
Alignment: Right

Syntax

DATEw.

Arguments

w

specifies the width of the output field.

Default 7
Range 5–9
Tip Use a width of 9 to print a 4-digit year.

Details

The DATEw. format writes SAS date values in the form ddmmmyy, ddmmmyyyy, or dd-mmm-yyyy where
dd
is an integer that represents the day of the month.
mmm
is the first three letters of the month name.
yy or yyyy
is a two-digit or four-digit integer that represents the year.
Note: SAS calculates date values based on the number of days since January 1, 1960.

Example

The example table uses the input value of 19431, which is the SAS date value that corresponds to March 14, 2013.
Statements
Results
----+----1----+
select put (19431,date5.);
14MAR
select put (19431,date6.);
 14MAR
select put (19431,date7.);
14MAR13
select put (19431,date8.);
 14MAR13
select put (19431,date9.);
14MAR2013
Last updated: February 23, 2017