I am not sure, that is understand your request completely. The following steps seem to create what you expect. In future questions please post data in usable form.
data have;
input ID age;
datalines;
1 131
1 0
1 0
2 22
2 76
3 0
3 48
3 48
3 3
;
/* Get lowest age for each id */
proc sql;
create table work.selection as
select distinct Id, Age
from work.have
group by Id
having Age = min(Age)
order by Age
;
quit;
/* Get all ages */
proc sort data= work.have(keep= Age) out= work.ages nodupkey;
by Age;
run;
/* Combine and count */
data want;
merge work.ages work.selection(keep= Age in= inc);
by Age;
if inc then Cumulative + 1;
if last.Age then output;
run;
... View more