Writes the date part of a datetime value as the year in the form yy or
yyyy.
Category: |
Date and Time
|
Alignment: |
right
|
-
w
-
specifies the width of the output field.
The DTYEARw. format is similar
to the YEARw. format in that they both write date values. The
difference is that DTYEARw. expects a datetime value as input,
and YEARw. expects a SAS date value.
The example table uses as input the value 1476598132,
which is the SAS datetime value that corresponds to October 16, 2006, at 06:08:52
a.m.
SAS Statement |
Results |
|
----+----1
|
put date dtyear.;
|
2006
|
put date dtyear2.;
|
06
|
put date dtyear3.;
|
06
|
put date year4.;
|
2006
|
Copyright © 2011 by SAS Institute Inc., Cary, NC, USA. All rights reserved.