How to read two records and compare them with a primary key in sequential file system?
问题 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 回答1: Bruce provides a good solution, but there is often more than one way to do