YEAR Function

Returns the year from a SAS date value.
Category: Date and Time

Syntax

YEAR(date)

Required Argument

date
specifies a SAS expression that represents a SAS date value.

Details

The YEAR function produces a four-digit numeric value that represents the year.

Example

The following SAS statements produce this result.
SAS Statement
Result
date='25dec97'd;
y=year(date);
put y;
1997

See Also