Previous Page | Next Page

Formats

DTYEARw. Format



Writes the date part of a datetime value as the year in the form yy or yyyy.
Category: Date and Time
Alignment: right

Syntax
Syntax Description
Comparisons
Examples
See Also

Syntax

DTYEARw.

Syntax Description

w

specifies the width of the output field.

Default: 4
Range: 2-4

Comparisons

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.


Examples

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


See Also

Formats:

DATETIMEw.d Format

YEARw. Format

Previous Page | Next Page | Top of Page