Agree with @PaigeMiller sequences are easier to maintain/use.
If you need the group_id within the new variable you can try this:
data have;
length group_id indicator 8;
input group_id indicator;
datalines;
1 1
1 0
1 0
1 1
1 0
1 0
1 0
2 1
2 0
;
run;
data want;
set have;
by group_id;
if first.group_id then index = 0;
if indicator = 1 then index+1;
new_id = cats(put(group_id,best.),'-',put(index,best.));
run;
But to get the result you need, try this:
data want;
set have;
by group_id;
if first.group_id then index = 0;
if indicator = 1 then index+1;
new_id = cats(put(group_id,best.),substr('abcdefghijklmnopqrstuvwxyz',index,1));
run;
It was not clear from your example how many times the indicator can change, but I guess the maximum with this technique would be 26.
Data never sleeps