Reading Date and Time Values | |
Reading Dates and Times Using
Informats |
Two-Digit Year Values
When a two-digit year value is read, SAS software defaults to a year within a 100-year span determined by the YEARCUTOFF= system option. The default value of YEARCUTOFF= is 1920. |
Date Expression | Interpreted As |
---|---|
12/07/41 | 12/07/1941 |
18Dec15 | 18Dec2015 |
04/15/30 | 04/15/1930 |
15Apr95 | 15Apr1995 |
However, you can override the default and change the value of YEARCUTOFF= to the first year of another 100-year span. For example, if you specify that YEARCUTOFF=1950, then the 100-year span will be from 1950 to 2049. |
Date Expression | Interpreted As |
---|---|
12/07/41 | 12/07/2041 |
18Dec15 | 18Dec2015 |
04/15/30 | 04/15/2030 |
15Apr95 | 15Apr1995 |
Specifying YEARCUTOFF= Using Programming Statements
As you learned earlier in the lesson Setting Up Your SAS Session, there are two methods for editing a system option. To use programming statements, you can submit an OPTIONS statement. |
General form, OPTIONS statement with YEARCUTOFF= option:
where yyyy is the four-digit value of the first year of the chosen 100-year span.
|
Specifying YEARCUTOFF= Using SAS Windows
Or, you can set the YEARCUTOFF= option in the SAS System Options window. To open this window, select Tools Options System Open the Input control option group, the Data Processing option group, and the YEARCUTOFF= option. Then specify a new value for YEARCUTOFF=. Regardless of how you edit the YEARCUTOFF= system option, the effect is global. In other words, the new value that you assign remains in effect until you change it or end the SAS session. |
Copyright © 2002 SAS Institute Inc.,
Cary, NC, USA. All rights reserved.