How can I automatically set the YEARCUTOFF= system option to 50 years prior to the current year?


Perform the calculation of the current year less 50 years in the DATA _NULL_ step. Assign the calculated year to a macro variable, then set the YEARCUTOFF= value from the macro variable. Execute this SAS code from within your autoexec file so that the |option is set automatically for each SAS job.

For example, add this SAS code to your autoexec:

data _null_;

call symput('year',put(year(today())-50,4.);

run;

options yearcutoff=&year;