This is the record format for my input file:

```
ID NAME Purchaseamount month
1  xxx  10000           feb
1  xxx  10000            mar
1  xxx  10000           apr
2  yyy  100              jan
2  yyy  2054             mar

```

How can I add the purchase amount for every person? I will give you the pseudo-code of my work. 

```
Read inputfile,
move to working storage variables,
end read,
perform until eof,
read input file,
if inputid = ws-input id,
add purchase amount,
else write to output file

```