You function call is not correct. Whet you will get with YEAR(TODAY()-4 is 2021-4, that is 2017. If you format that as a date, you will get a date that is 2017 days from 01JAN1960.
Instead, use the INTNX function:
%let date_old=%sysfunc(intnx(year,"&sysdate9."d,-4), yymmd7.)
Instead of the TODAY function, I used the automatic variable SYSDATE9, which contains the date that the SAS system was started (would normally be today).
If you must use the TODAY function, you must enclose that in as %SYSFUNC call as well:
%let date_old=%sysfunc(intnx(year,%sysfunc(TODAY()),-4), yymmd7.);
... View more