Expects a datetime value as input and writes date values in the
form ddmmmyy or ddmmmyyyy.
Category: |
Date and Time
|
Alignment: |
right
|
-
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. |
The DTDATEw.
format writes SAS date values in the form ddmmmyy
or ddmmmyyyy, where
-
dd
-
is an integer that represents the day of
the month.
-
mmm
-
are the first three letters of the month
name.
-
yy or yyyy
-
is a two-digit or four-digit integer that
represents the year.
The DTDATEw.
format produces the same type of output that the DATEw.
format produces. The difference is that the DTDATEw.
format requires a datetime value.
The example table uses a datetime value of 16APR2000:10:00:00
as input, and prints both a two-digit and a four-digit year for the DTDATEw. format.
SAS Statement |
Results |
|
- - - - + - - - - + |
put trip_date=dtdate.;
|
16APR00
|
put trip_date=dtdate9.;
|
16APR2000
|
Copyright © 2011 by SAS Institute Inc., Cary, NC, USA. All rights reserved.