Chapter Contents

Previous

Next
MMYYxw.

MMYYxw.



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

Category: Date and Time
Alignment: right


Syntax
Syntax Description
Details
Examples
See Also

Syntax

MMYYxw.

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
MMYYw. uppercase M
MMYYCw. colon
MMYYDw. dash
MMYYNw. no separator
MMYYPw. period
MMYYSw. 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 mmyy5.;
03M02
put date mmyyc7.;
03:2002
put date mmyyd7.;
03-2002
put date mmyyn6.;
032002
put date mmyyp6.;
 03.02
put date mmyys7.;
03/2002


See Also

Format:

YYMMxw.


Chapter Contents

Previous

Next

Top of Page

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