Previous Page | Next Page

Formats

YYMMDDxw. Format



Writes date values in the form yymmdd or <yy>yy-mm-dd, where the x in the format name is a character that represents the special character which separates the year, month, and day. The special character 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

YYMMDDxw.

Syntax Description

x

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

B

separates with a blank

C

separates with a colon

D

separates with a dash

N

indicates no separator

P

separates with a period

S

separates with a slash.

w

specifies the width of the output field.

Default: 8
Range: 2-10
Interaction: When w has a value of from 2 to 5, the date appears with as much of the year and the month. When w is 7, the date appears as a two-digit year without separators.
Interaction: When x has a value of N, the width range is 2-8.

Details

The YYMMDDxw. format writes SAS date values in the form yymmdd or <yy>yyxmmxdd, where

<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.

dd

is an integer that represents the day of the month.


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 day yymmddc5.;
09:05
put day yymmddd8.;
09-05-14
put day yymmddp10.;
2009.05.14
put day yymmddn8.;
20090514


See Also

Formats:

DATEw. Format

DDMMYYxw. Format

MMDDYYxw. Format

YYMMDDw. Format

Functions:

DAY Function

MDY Function

MONTH Function

YEAR Function

Informat:

YYMMDDw. Informat

Previous Page | Next Page | Top of Page