YYQ Function

Returns a SAS date value from year and quarter year values.

Category: Date and Time
Returned data type: DOUBLE

Syntax

YYQ(year, quarter)

Arguments

year

specifies any valid expression that evaluates to a two-digit or four-digit integer that represents the year.

Interaction The YEARCUTOFF= system option defines the year value for two-digit dates.
Data type DOUBLE
See DS2 Expressions in SAS DS2 Language Reference

quarter

specifies the quarter of the year (1, 2, 3, or 4).

Data type DOUBLE
See DS2 Expressions in SAS DS2 Language Reference

Details

The YYQ function returns a SAS date value that corresponds to the first day of the specified quarter. If either year or quarter is null or missing, or if the quarter value is not valid, the result is a null or missing value.

Example

The following statements illustrate the YYQ function:
Statements
Results
DateValue=yyq(2006,3);
Date7Value = put(DateValue, date7.);
Date9Value = put(DateValue, date9.);
16983
01JUL06
01JUL2006
StartOfQuarter=yyq(2006,4);
StartOfQuarter9=put(StartOfQuarter,date9.);
17075
01OCT2006

See Also

Dates and Times in DS2 in SAS DS2 Language Reference
Functions:
YEAR Function in SAS DS2 Language Reference