I'll preface this with my standard "this is a bad idea, there is a better way to do (your problem) than producing lots of datasets in a macro loop", but that said:
%MACRO NFORE;
%LET UC=100;
%LET YS=2012;
%DO yrs= &ys. %TO %eval(&ys.+10);
proc sql;
create table FORECAST_&YRS as
select *
,case when ("31DEC&YRS."d-EIS)/365<=10 then Segment_10
when ("31DEC&YRS."d-EIS)/365<=20 then Segment_20
when ("31DEC&YRS."d-EIS)/365<=30 then Segment_30
when ("31DEC&YRS."d-EIS)/365<=99 then Segment_35
else stat end as TSN_AGE_&YRS
from F_AG;
quit;
%END;
%MEND NFORE;
%NFORE;
A slightly superior solution in terms of calculating actual years would be to use the INTCK
function to determine years between dates, which would handle leap years - or even use the YEAR
function on EIS and just compare &yrs. to year(EIS), since you're using DEC 31 anyway.