YEARw. Format
Writes SAS date values as the year.
| Category: |
Date and Time |
| Alignment: |
Right |
Syntax
Arguments
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.
|
Comparisons
The YEAR
w.
format is similar to the DTYEAR
w.
format in that they both write date values. The difference is that
YEAR
w. expects a SAS date value
as input, and DTYEAR
w. expects
a SAS datetime value.
Example
The example table uses
the input value of 19537, which is the SAS date value that corresponds
to June 28, 2013.
|
|
|
|
|
|
select put(19537,year2.);
|
|
select put(19537,year4.);
|
|