Writes date values in the form <yy>yyqr or
<yy>yy-qr, where the x
in the format name is a character that represents the special character that
separates the year and the quarter or the year, which can be a hyphen (-),
period (.), blank character, slash (/), colon (:), or no separator; the year
can be either 2 or 4 digits and qr is the quarter of the year
expressed in roman numerals.
Category: |
Date and Time
|
Alignment: |
right
|
-
x
-
identifies a separator or specifies that
no separator appear between the year and the quarter. Valid values for x are:
-
C
-
separates with a colon
-
D
-
separates with a dash
-
N
-
indicates no separator
-
P
-
separates with a period
-
S
-
separates with a forward slash.
-
w
-
specifies the width of the output field.
Default: |
8 |
Range: |
6-32 |
Interaction: |
When x
is set to N, no separator is specified. The width
range is then 5-32, and the default changes to 7. |
Interaction: |
When the value of w is too small to write a four-digit year, the date appears
with only the last two digits of the year. |
The YYQRxw.
format writes SAS date values in the form <yy>yyqr or
<yy>yyxqr,
where
-
<yy>yy
-
is a two-digit or four-digit integer that
represents the year.
-
x
-
is a specified separator.
-
qr
-
is a roman numeral (I, II, III, or IV) that
represents the quarter of the year.
The following examples use the input value of 18031,
which is the SAS date value that corresponds to May 14, 2009.
SAS Statement |
Result |
|
----+----1----+
|
put date yyqrc6.;
|
09:II
|
put date yyqrd.;
|
2009-II
|
put date yyqrn5.;
|
09II
|
put date yyqrp8.;
|
2009.II
|
put date yyqrs10.;
|
2009/II
|
Copyright © 2011 by SAS Institute Inc., Cary, NC, USA. All rights reserved.