Previous Page | Next Page

Formats

MMYYxw. Format



Writes date values in the form mm<yy>yy or mm-<yy>yy, where the x in the format name is a character that represents the special character that separates the month and the year, which can be a hyphen (-), period (.), blank character, slash (/), colon (:), or no separator; the year can be either 2 or 4 digits.
Category: Date and Time
Alignment: right

Syntax
Syntax Description
Details
Examples
See Also

Syntax

MMYYxw.

Syntax Description

x

identifies a separator or specifies that no separator appear between the month and the year. 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: 7
Range: 5-32
Interaction: When x is set to N, no separator is specified. The width range is then 4-32, and the default changes to 6.
Interaction: 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.
Interaction: 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 MMYYxw. format writes SAS date values in the form mm<yy>yy or mmx<yy>yy, where

mm

is an integer that represents the month.

x

is a specified separator.

<yy>yy

is a two-digit or four-digit integer that represents the year.


Examples

The following examples use the input value of 18031, which is the SAS date value that corresponds to May 14, 2009.

SAS Statement

Results
 
----+----1----+
put date mmyyc5.;
05:09
put date mmyyd.;
05-2009
put date mmyyn4.;
0509
put date mmyyp8.;
 05.2009
put date mmyys10.;
   05/2009


See Also

Format:

MMYYw. Format

YYMMxw. Format

Previous Page | Next Page | Top of Page