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;
Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.
Register today!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.