Writes date values as the year.
Category: |
Date and Time
|
Alignment: |
right
|
-
w
-
specifies the width of the output field.
Default: |
4 |
Range: |
2-32 |
Tip: |
If w
is less than 4, the last two digits of the year print. Otherwise,
the year value prints as four digits. |
The YEARw. format is similar
to the DTYEARw. format in that they both write date values. The
difference is that YEARw. expects a SAS date value as input,
and DTYEARw. expects a datetime value.
The example table uses the input value of 16601, which
is the SAS date value that corresponds to June 14, 2005.
SAS Statement |
Results |
|
----+----1
|
put date year2.;
|
05
|
put date year4.;
|
2005
|
Copyright © 2011 by SAS Institute Inc., Cary, NC, USA. All rights reserved.