How to Calculate the year which is 20 years from run date. E.g if today’s date is 11MAY2020, then this step will give year 2040.
I have used the below code but didn't find the solution.
data want;
set have;
do n=1 to 20 by +1;
date=intnx('year', &rundate, +n);
format date ddmmyyn8.;
output;
end;
run;
no need of do loop, please try the below code
data want;
date=intnx('year', today(), +20,'SAME');
format date ddmmyyn8.;
run;
no need of do loop, please try the below code
data want;
date=intnx('year', today(), +20,'SAME');
format date ddmmyyn8.;
run;
HI @annypanny
data have;
format today_date date9.;
today_date = today();
year20 = year(intnx('year',today_date,20,"s"));
run;
Another possibility
year_in_future = year(today())+20;
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.
Find more tutorials on the SAS Users YouTube channel.