Chapter Contents

Previous

Next
YYMMxw.

YYMMxw.



Writes date values as the year and month and separates them with a character

Category: Date and Time
Alignment: right


Syntax
Syntax Description
Details
Examples
See Also

Syntax

YYMMxw.

Syntax Description

x
specifies the separators, which can be colons, dashes, periods, or other specific characters. For a list of the possible values of x, see the table in Details.

w
specifies the width of the output field.
Default: 7
Range: 5-32
Interaction: when no separator is specified by setting x to N, the width range is 4-32 and the default changes to 6.
Tip: If w is too small to print a four-digit year, only the last two digits of the year print.


Details

The following table shows the separators that correspond to the possible x values:

Syntax Separator
YYMMw. uppercase M
YYMMCw. colon
YYMMDw. dash
YYMMNw. no separator
YYMMPw. period
YYMMSw. forward slash


Examples

The example table uses the input value of 15415, which is the SAS date value that corresponds to March 16, 2002.

SAS Statements Results

----+----1----+
put date yymm7.;
2002M03
put date yymmc7.;
2002:03
put date yymmd7.;
2002-03
put date yymmn6.;
200203
put date yymmp7.;
2002.03
put date yymms7.;
2002/03


See Also

Format:

MMYYxw.


Chapter Contents

Previous

Next

Top of Page

Copyright 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.