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;
Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9. Sign up by March 14 for just $795.
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.