YYQw. Informat

Reads quarters of the year in the form yyQq or yyyyQq.

Category: Date and Time

Syntax

YYQw.

Syntax Description

w

specifies the width of the input field.

Default 6 (For SAS version 6, the default is 4.)
Range 4–32 (For SAS version 6, the range is 4–6.)

Details

SAS reads data in one of the following forms:
  • yyQq
  • yyyyQq
yy or yyyy
is an integer that represents the two-digit or four-digit year.
q
is an integer (1, 2, 3, or 4) that represents the quarter of the year. You can also represent the quarter as 01, 02, 03, or 04.
The letter Q must separate the year value and the quarter value. The year value, the letter Q, and the quarter value cannot be separated by blanks. A value that is read with YYQw. produces a SAS date value that corresponds to the first day of the specified quarter.
Note: SAS interprets a two-digit year as belonging to the 100-year span that is defined by the YEARCUTOFF= system option.

Example

input quarter yyq9.; 
Data Line
Result
----+----1----+
12Q2
19084
12Q02
19084
2012Q02
19084

See Also

Functions:
QTR Function in SAS Functions and CALL Routines: Reference
YEAR Function in SAS Functions and CALL Routines: Reference
YYQ Function in SAS Functions and CALL Routines: Reference
System Options:
YEARCUTOFF= System Option in SAS System Options: Reference