September 15, 1999
A GUIDE TO THE YEARCUTOFF= OPTION
(Note: this document revises/replaces TS-597.)
THIS IS A YEAR 2000 READINESS DISCLOSURE
The YEARCUTOFF= option is used by SAS software to assign a century
prefix to two-digit years used in SAS programs and input data. In
order to make your SAS applications Year 2000 compliant, it is
important to understand and correctly use the YEARCUTOFF= option.
The following questions and answers provide detailed information
on the usage of the option.
What is the YEARCUTOFF= option and how does it work?
Q: What is the YEARCUTOFF= option?
A: The YEARCUTOFF= option lets you specify what century SAS
software should assign to dates with two-digit years.
Q: How do I specify the YEARCUTOFF= option in my SAS programs?
A: The option is specified in an OPTIONS statement--for example:
You can also specify the option in an autoexec file or a
config file. If you don't specify the YEARCUTOFF= option, the
SAS system default is used. See "Default Values for the
YEARCUTOFF= Option" below for more details on default values.
Q: How does the YEARCUTOFF= option work?
A: The YEARCUTOFF= option specifies the first year of a 100 year
window in which all 2-digit years are assumed to be. For
example, if the YEARCUTOFF= option is set to 1920, all 2-digit
years are assumed to be in the period 1920 through 2019. This
means that two-digit years from 20-99 will be assigned a
century prefix of '19' and all 2-digit years from 00-19 will
have a century prefix of '20'.
Q: What types of date values are, and are not, affected by the
A: The YEARCUTOFF= option affects the interpretation of two-digit
years in the following cases:
* Reading date values from external files
* Specifying dates or year values in SAS functions
* Specifying SAS date literals
The YEARCUTOFF= option has no effect in the following cases:
* Processing dates with 4-digit years
* Processing dates already stored as SAS date values (the
number of days since January 1, 1960)
* Displaying dates with SAS date formats
Here are some specific examples. Assume that YEARCUTOFF=1930
has been specified:
date=mdy(1,1,29) returns January 1, 2029 (YEARCUTOFF= is used)
date=mdy(1,1,1929) returns January 1, 1929 (YEARCUTOFF= not
date='01jan25'd returns January 1, 2025 (YEARCUTOFF= is used)
date='01jan1925'd returns January 1, 1925 (YEARCUTOFF= not
Q: What value should I set the YEARCUTOFF= option to?
A: The optimal value depends on the range of dates in your data.
The YEARCUTOFF= option should be set so that the 100 year
range that it covers encompasses the range of your data. In
general, we recommend setting the YEARCUTOFF= option to a
value equal to or slightly less than the first year in your
data. For example, if the range of dates you are processing
is from 1930-2010, a YEARCUTOFF value of 1925 or 1930 would be
appropriate. If you set YEARCUTOFF=1925, then all two-digit
years are assumed to be in the 100 year period from 1925 to
2024, and if all of the dates in your data fall within that
range, they will be interpreted correctly.
Q: Should I reset the YEARCUTOFF= option to 2000 on January 1,
A: No. By setting the YEARCUTOFF= option to 2000, all dates with
two-digit years would be interpreted as being in between 2000
and 2099. This means that a date such as 01MAR98 would be
assumed to be March 1, 2098. Unless you want all two-digit
years interpreted as being between 2000 and 2099, you probably
don t want to set YEARCUTOFF=2000.
Q: Can you give an example of the use and effect of the
A: In the example below the YEARCUTOFF= option has been set to
1920 and the dates in the data have 2- and 4-digit years.
This example illustrates how the YEARCUTOFF= option affects
2-digit years and has no effect on 4-digit years.
input @1 jobid $ @6 projdate mmddyy10.;
/* Note: mmddyy10. format can read 2- or 4-digit years */
format projdate mmddyy10.;
The output from PROC PRINT:
OBS JOBID PROJDATE
1 A100 01/15/1925
2 A110 03/15/2025
3 A200 01/30/1996
4 B100 02/05/2000
5 B200 06/15/2000
Q: What do I do if my dates with 2-digit years span more than 100
A: The YEARCUTOFF= option cannot reliably assign centuries to
two-digit years if the range of dates for a variable is
greater than 100 years. If the date ranges for a variable
span more than 100 years, you must either specify the dates
with 4-digit years, or use DATA step logic to assign a century
to each year (perhaps based on the value of another variable).
If the total range of dates in your data spans more than 100
years, but each variable covers less than a 100 year span, you
can read the dates in with separate DATA steps, and change the
value of the YEARCUTOFF= option between steps. For example,
suppose you have a file with birthdates which range from 1900-
1999 and a second file with appointment dates which all occur
after 1990, and you want to merge the two files so you can
print out a person s birthdate and appointment date. You can
read the two files in with separate DATA steps and use a
different YEARCUTOFF= value for each DATA step:
input @1 id $ @3 bdate mmddyy8.;
input @1 id $ @3 projdate mmddyy8.;
merge people schedule;
Q: Why does the YEARCUTOFF= option only allow a 100 year span?
A: If the YEARCUTOFF= option allowed for more than a 100 year
span, there would be no way to determine what century a 2-
digit year should have. For example, let s assume that
YEARCUTOFF=1950 with a 150 year span and your external data
file had 2-digit years. In this scenario your 150 year span
would be from 1950 to 2100. Since you have 2-digit years,
there would be no way to determine if the year 00 was meant to
be 2000 or 2100.
Default values for the YEARCUTOFF= option
Q: What is the default value of the YEARCUTOFF=option?
A: Beginning with its introduction in Release 6.06, the default
value for the YEARCUTOFF= option is 1900. In Version 7 and
Version 8 the default setting is 1920. Note that you will NOT
want to use the Version 6 default of 1900 in your applications
that process dates after January 1, 2000.
Q: Why should I reset the YEARCUTOFF= option from the default
setting of 1900 in Version 6?
A: If the default YEARCUTOFF= value of 1900 is used, all dates
with two-digit years will be interpreted as being in the
1900 s. For example, the date 26JUL05 will be interepreted as
July 26, 1905. Note that if you are processing dates that
don t go past 1999, you can use the default value of 1900.
Q: I haven t changed my YEARCUTOFF= option; however, when I run
PROC OPTIONS in Version 6, the value of YEARCUTOFF= is 1920
instead of the default of 1900. Why?
A: Someone at your site has changed the default value of the
YEARCUTOFF= option at the system level (see "How do I change
the default setting for all of the SAS users at my site?"
below). You can override the value by specifying an OPTIONS
statement in your program, in an autoexec or personal
configuration file, by setting an environment variable, or by
specifying the option at SAS invocation. The precedence of
options affects which value the YEARCUTOFF= option will have
for your program. Please see the SAS Language Guide for
details on the order of precedence of options.
Q: How do I change the default setting for all of the SAS users
at my site?
A: Setting system default option values is usually done by a
site s SAS Installation Representative. The recommended
method for setting a system default YEARCUTOFF= value is to
specify the desired value in the system SAS configuration
file. Note that even if you set a default value for all of
the users at your site, they can override the default value in
their SAS programs, in personal AUTOEXEC files, in CONFIG
files, by setting an environment variable, or when invoking
MVS (OS/390)--The system configuration file is usually
referenced by the DDname of CONFIG in the SAS catalogued
procedure or SAS CLIST. To change the default value for the
YEARCUTOFF= option, your SAS Installation Representative
should edit the configuration file and add (or replace) a line
specifying the desired value--for example:
CMS--In Version 6, the system-wide SAS configuration file is
the file SYSPROF SAS on the SAS system disk; in Version 7, the
configuration file is SASV7SYS CONFIG. To change the default
value, edit the file and add (or replace) a line specifying
the desired value--for example:
VSE--For batch jobs, in the catalogued procedure there is a
CONFIG DLBL which points to the default configuration file.
For multi-user there is a CONFIG DLBL in the multi-user
startup job which points to a separate configuration file.
To change the default value, edit each file and add (or
replace) a line specifying the desired value--for example:
Windows or OS/2(r)--The system configuration file is located
in the root of your SAS Installation directory. In Version 6,
the file is named CONFIG.SAS; in Version 7, the file is named
SASV7.CFG. To modify the default YEARCUTOFF= value, edit the
configuration file using either the SAS Program Editor or an
ASCII text editor such as Notepad (NOT a word processor). If
a value is specified in the file, it can be changed; otherwise
a line specifying the desired value should be added at the top
of the file--for example:
OpenVMS/VAX or OpenVMS/Alpha--The configuration file can be
executed on the command line or by defining the SAS$CONFIG
logical to point to it. The SAS$CONFIG logical can be defined
as a system, group, job, or process logical. To change the
default value, edit the file and add (or replace) a line
specifying the desired value--for example:
UNIX--The system configuration file is located in the root of
your SAS Installation directory. In Version 6, the file is
named config.sasxxx (where xxx is the release of SAS, such as
612); in Version 7, the file is named sasv7.cfg. To modify
the default YEARCUTOFF= value, edit the configuration file and
add (or replace) a line specifying the desired value--for
Macintosh--The system configuration file is CONFIG.SAS612,
and it MUST be in the top level SAS folder. Edit the
configuration file and add (or replace) a line specifying
the desired value--for example:
Q: How do I change the default setting for my own programs if I
want a default that is different from the rest of the users at
A: You can specify personal default values either in a personal
configuration file, or in an autoexec file. If you specify
the value in a personal configuration file, the syntax depends
on your operating system and is the same as that for setting
the value in the system-wide configuration file on each
system. If you use an autoexec file, you can specify the
YEARCUTOFF= option in an OPTIONS statement; for example:
This archive was generated by hypermail 2b29 : Mon Jan 10 2000 - 10:10:20 EST