BookmarkSubscribeRSS Feed
ShelleySessoms
Community Manager

In SAS 9.3 and earlier, the default value of the YEARCUTOFF= option is 1920. This default setting could trigger data integrity issues because any 2-digit years of "20" in dates will be assumed to occur in 1920 instead of 2020. If the intended year in the date is 2020, you must set the YEARCUTOFF= option to a value larger than 1920. Of course, the best alternative is to always specify date values with 4-digit years.

 

Luckily, SAS makes it easy to change the YEARCUTOFF= option so that it works best for your data. The default value for the YEARCUTOFF= option changed in SAS 9.4 to 1926. This change makes it easier for customers who are still using 2-digit years of "20" to make sure that the date is assigned to 2020. Let's review some of the frequently asked questions that customers ask about how SAS works with 2-digit years.

 

Find out more about this topic in this comprehensive blog post (including links to the relevant SAS Notes): https://blogs.sas.com/content/sgf/2020/01/10/yearcutoff-date/

1 REPLY 1
RichardDeVen
Barite | Level 11

You can create an autoexec.sas statement that will always set the cutoff according to your own max 'years ago' criteria.

 

Autoexec.sas

 

options yearcutoff = %eval(-94+%sysfunc(year(%sysfunc(date()))));  * 94 years ago is oldest inferred year from formats considering just YY;