3.3.7+Master+&+Transaction+file

=__**Master and Transaction File**__= A PowerPoint presentation showing the principle of master & transaction files

Holds descriptive data; the actual data that is supposed to be processed and holds the resultant data after the process is completed (ex. names, addresses, sales, etc.). The data can be organized using keys.
 * __Master file__**

Contains the transactions; changes that are supposed to be made to the data in the master file.
 * __Transaction file__**
 * In batch processing all transactions are collected in the transaction file and the changes are applied to the master file sequentially in a single pass. For this to be possible, both the master and transaction file have to be sorted first.
 * In an online system the changes are applied to the master file the moment the transactions occur or are recorded.


 * Key** - Unique identifier for a record.

__**Algorithm to update the Master file**__
 * 1) Order transaction file by key.
 * 2) Create new master file.
 * 3) Compare first keys in master file to first key in transaction file.
 * 4) Continue this until end of both master and transaction file.
 * 5) Apply any changes defined by the transaction file to the record.
 * 6) Write the record with the lowest key to the new master file.
 * 7) Go to the next record in the original master file and the transaction file.
 * 8) Compare keys as in step 3.
 * 9) Close all files.

Edited by Jocbe Last update: 8. November 2010

Sources:
 * "Definition of: transaction file." PCMAG.com. N.p., 2010. Web. 8 Nov. 2010. .
 * "Definition of: master file." PCMAG.com. N.p., 2010. Web. 8 Nov. 2010. .
 * Jones, Richard. Computer Science Java Enabled. Victoria: IBID Press, 2004.