YYMMxw. Format

Writes SAS date values in the form [yy]yymm or [yy]yy-mm. The x in the format name represents the special character that separates the year and the month. This special character can be a hyphen (-), period (.), slash(/), colon(:), or no separator. The year can be either 2 or 4 digits.

Category: Date and Time
Alignment: Right

Syntax

YYMMxw.

Arguments

x

identifies a separator or specifies that no separator appear between the year and the month. Valid values for x are any of the following:

C

separates with a colon

D

separates with a hyphen

N

indicates no separator

P

separates with a period

S

separates with a forward slash

w

specifies the width of the output field.

Default 7
Range 5–32
Interactions When x is set to N, no separator is specified. The width range is then 4–32, and the default changes to 6.
When x has a value of C, D, P, or S and w has a value of 5 or 6, the date appears with only the last two digits of the year. When w is 7 or more, the date appears with a four-digit year.
When x has a value of N and w has a value of 4 or 5, the date appears with only the last two digits of the year. When x has a value of N and w is 6 or more, the date appears with a four-digit year.

Details

The YYMMxw. format writes SAS date values in one of the following forms:
yymmdd
[yy]yy-mmxdd
<yy>yy
is a two-digit or four-digit integer that represents the year.
x
is a specified separator.
mm
is an integer that represents the month.

Example

The following examples use the input value of 19537, which is the SAS date value that corresponds to June 28, 2013.
Statements
Results
 
----+----1----+
select put(19537,yymmc5.);
13:06
select put(19537,yymmd.);
2013-06
select put(19537,yymmn4.);
1306
select put(19537,yymmp8.);
 2013.06
select put(19537,yymms10.);
   2013/06