QTR Function

Returns the quarter of the year from a SAS date value.

Category: Date and Time

Syntax

QTR(date)

Required Argument

date

specifies a numeric constant, variable, or expression that represents a SAS date value.

Details

The QTR function returns a value of 1, 2, 3, or 4 from a SAS date value to indicate the quarter of the year in which a date value falls.

Example

The following SAS statements produce this result:
SAS Statement
Result
x='20jan94'd;
y=qtr(x);
put y=;
 
y=1

See Also

Functions: