YYMMNw. Informat

Reads date values in the form yyyymm or yymm.
Category: Date and Time

Syntax

YYMMNw.

Syntax Description

w
specifies the width of the input field.
Default:4
Range:4–6

Details

SAS reads date values in one of the following forms:
  • yyyymm
  • yymm
yy or yyyy
is a two-digit or four-digit integer that represents the year.
mm
is a two-digit integer that represents the month.
The N in the informat name must be used and indicates that you cannot separate the year and month values by blanks or by special characters. SAS automatically adds a day value of 01 to the value to make a valid SAS date variable.
Note: SAS interprets a two-digit year as belonging to the 100-year span that is defined by the YEARCUTOFF= system option.

Example

input date1 yymmn6.;
Data Line
Result
----+----1
201208
19206

See Also

Functions:
DAY Function in SAS Functions and CALL Routines: Reference
MONTH Function in SAS Functions and CALL Routines: Reference
MDY 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