YYMMDDw. Informat

Reads date values in the form yymmdd or yyyymmdd.

Category: Date and Time

Syntax

YYMMDDw.

Syntax Description

w

specifies the width of the input field.

Default 6
Range 6–32

Details

SAS read date values in one of the following forms:
  • yymmdd
  • yyyymmdd
yy or yyyy
is a two-digit or four-digit integer that represents the year.
mm
is an integer between 01 and 12 that represents the month of the year.
dd
is an integer between 01 and 31 that represents the day of the month.
You can separate the year, month, and day values by blanks or by special characters. However, if delimiters are used, place them between all the values. You can also place blanks before and after the date. Make sure the width of the input field allows space for blanks and special characters.
Note: SAS interprets a two-digit year as belonging to the 100-year span that is defined by the YEARCUTOFF= system option.

Example

input calendar_date yymmdd10.;
Data Line
Result
----+----1
120316
19068
12/03/16
19068
12 03 16
19068
2012-03-16
19068

See Also

Functions:
DAY Function in SAS Functions and CALL Routines: Reference
MDY Function in SAS Functions and CALL Routines: Reference
MONTH Function in SAS Functions and CALL Routines: Reference
YEAR Function in SAS Functions and CALL Routines: Reference
System Options:
YEARCUTOFF= System Option in SAS System Options: Reference