FILE1SNG.DAT (Inventory) |
FILE2MUL.DAT (Sales) |
FILE3MUL.DAT (Receipts) |
111100 222200 333300 444400 555500 666600 888800 |
111001 111010 222022 222222 300003 444004 444040 444444 555006 666006 666060 777007 |
111110 111011 112012 222022 333033 333303 444404 666606 666060 |
Assignment:
Assume that FILE1SNG.DAT is the master inventory file and that FILE2MUL.DAT is sales and that FILE3MUL.DAT is receipts. Write the program to create a new master inventory file with the sales subtracted from amt and the receipts added to amount. Note that in some cases the amt on the master inventory file may not be big enough to accommodate the sales. In this case, carry the data on the master inventory file as negative.
It is valid to have no activity (sales or receipts) for the master but it is not valid to have a sale or receipt with no matching record on the master inventory file. When this occurs, an error should be written to the printer.
You may use any of my programs as a base for altering and producing this logic.