Here is a simple data step with loops.
data have;
input ID AGE;
cards;
1 14
1 30
2 28
2 40
;
run;
data want;
do _N_=1 by -1 until(last.id);
set have;
by id;
if first.id then age_start=age;
if last.id then do;
age_stop=age;
do age=age_start to age_stop by 1;
output;
end;
end;
end;
drop age_:;
run;