| File Update | ||||||||||||||||||||||||||||||
| The data on a transaction
file is used to update
some of the fields on a master file.
The transaction file must be sorted in the same order as the master file.
|
This is generally done in a batch processing system where the transactions are recorded on the transaction file and later used to update the master file. | |||||||||||||||||||||||||||||
How it works (in
words) :
|
||||||||||||||||||||||||||||||
| How it works (System
flowchart) :
|
||||||||||||||||||||||||||||||
|
|
Here, the transaction and master files are
stored on magnetic tape and used as input for the update process.
All updated (and unaltered) records are stored on the new master file. |
|||||||||||||||||||||||||||||
|
Example : A master file of stock is kept for a
clothes shop. Some of the
records are shown in this table : |
||||||||||||||||||||||||||||||
|
The key
field is the ID field.
The master file in practice would have many more fields than this ...and many more records! |
|||||||||||||||||||||||||||||
| Todays transactions are shown in the transaction file below.... | ||||||||||||||||||||||||||||||
|
The transaction file must be sorted in the same order as the master file (using the key field) | |||||||||||||||||||||||||||||
| The resulting new master file is shown in the next table : | ||||||||||||||||||||||||||||||
|
The updated data is shown in red. Note that some records will have remained unchanged. | |||||||||||||||||||||||||||||
| Exercise : | ||||||||||||||||||||||||||||||
| The
contains all the main data for a system. A
contains
recent data which is used to update the master file.
A is created onto which the updated or unchanged records are written. The old master file can then be archived. The transaction file must be before the update process takes place.
|
||||||||||||||||||||||||||||||
| (Green indicates success) | ||||||||||||||||||||||||||||||