The problem, that if the else is executing, increment of S will not accomplish. Any idea?
data osszes_folyositas;
set osszes_tabla;
retain old_xname;
retain s 0;
if xname ne old_xname then
do;
old_xname = xname;
s = 0;
end;
else
do;
s = s + Foly_s_tott_t_rgyh_ban_HUF;
delete;
end;
run;
Not sure what you are trying to do. But if you have your records ordered by “xname”, and for each group of “xname” just want to sum across a value, you could try the following.
This resets “s” for each group of “xname” and outputs the last record with “s” set to the sum of “myvalue” across the group. The result looks like this: