Chapter Contents

Previous

Next
YYMMDDxw.

YYMMDDxw.



Writes date values in the form yymmdd or yyyymmdd with a specified separator

Category: Date and Time
Alignment: right


Syntax
Syntax Description
Details
Examples
See Also

Syntax

YYMMDDxw.

Syntax Description

x
specifies a separator or no separator, where

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.

Note:   When x is N, the width range is 2-8.  [cautionend]

Default: 8
Range: 2-10
Tip: When w is from 2 to 5, SAS prints as much of the month and day as possible. When w is 7, the date appears as a two-digit year without separators, and the value is right aligned in the output field.


Details

The YYMMDDxw. format writes SAS date values in the form yymmdd or yyyymmdd, where

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

mm
is an integer that represents the month.

dd
is an integer that represents the day of the month.


Examples

The example table uses the input value of 15595, which is the SAS date value that corresponds to September 12, 2002.

SAS Statements Results

----+----1----+
put day yymmddc5.;
02:09
put day yymmddd8.;
02-09-12
put day yymmddp10.;
2002.09.12
put day yymmddn8.;
20020912


See Also

Formats:

DATEw.
DDMMYYxw.
MMDDYYxw.

Functions:

DAY
MDY
MONTH
YEAR

Informat:

YYMMDDw.


Chapter Contents

Previous

Next

Top of Page

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