Previous Page | Next Page

Formats

YEARw. Format



Writes date values as the year.
Category: Date and Time
Alignment: right

Syntax
Syntax Description
Comparisons
Examples
See Also

Syntax

YEARw.

Syntax Description

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 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.


Examples

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


See Also

Format:

DTYEARw. Format

Previous Page | Next Page | Top of Page