data: begin of SERIES,
N1 type I value 10,
N2 type I value 20,
N3 type I value 30,
N4 type I value 40,
N5 type I value 50,
N6 type I value 60,
end of SERIES.
data SUM type I.
add SERIES-N1 then SERIES-N2 until SERIES-N5 giving SUM.
write SUM.
add SERIES-N2 then SERIES-N3 until SERIES-N6 to SUM.
write / SUM.
output:
150
350