0% found this document useful (0 votes)
34 views19 pages

1.5 Batch Processing

Download as pdf or txt
Download as pdf or txt
Download as pdf or txt
You are on page 1/ 19

Teacher: Laila Fakhoury

- In Section 1.1, data must be processed so that it can become information.


- Data can include personal data, transaction data, sensor data and much more.
- Data processing is when data is collected and translated into usable information.
- Data processing starts with data in its raw form and translates it into a more readable format such as diagrams,
graphs, and reports ( Types of outputs)
- Need :The processing is required to give data the structure and context necessary so it can be understood by other
computers and then used by employees throughout an organisation.
- There are several different methods of data processing, but the three most popular ones are :

batch, online, and real-time.


We will now consider each of these in turn.

Teacher: Laila Fakhoury


The meaning of Transaction :
1. In business, a transaction occurs when someone buys or sells something
2. but in IT the term ‘transaction’ can mean much more, such as adding, deleting or changing values in a
database.

Teacher: Laila Fakhoury

Use:
Batch processing is still used today as it is an effective method of processing large volumes of data; sometimes millions
of transactions are collected over a period of time. The data is entered and processed altogether in one batch by
the computer, which then produces the required results.The processing of one batch is often called a job.

Benefit: Batch processing allows computers to process data when computing resources are not being fully utilized, such as
overnight, and requires very little, and often no, human interaction.

Examples of batch processing include payrolls and customer billing systems. (tell me why ?)
Batch processing benefits: (Important )
- It allows a business to process jobs at the times of day when computer resources are not being used fully, thereby saving the cost of
the computer doing very little.
- Companies are able to make sure that vital tasks which need immediate attention, such as online services, can use the computer
resources as and when needed.
- They can then timetable batch-processing jobs for those times of day when online processing tasks are fewer.
- Compared to real-time processing, batch processing requires a simpler computer system without complex hardware or software.
(why)

- Once the system is up and running, it does not need as much maintenance as a real-time system and, because there is less human
interaction, data entry methods used in batch processing tend to be more accurate
- (list of example) Many utility companies such as water, gas and electricity companies handle huge amounts of data in their billing
systems.
- Batch processing the collection of data, calculating and printing the bills can be done mainly at night, so that the computers can be
used to help control the actual delivery of the utility during the busy part of the day.

Teacher: Laila Fakhoury


Example where batch processing is used include automated backups , the processing of employees wages ,
customer orders and Stock control.

Two main files that are used to store data , Master files and transactions files .

A master file usually stores data about a thing such as a person , place or object.

A transaction file usually stores data about an event such as order , electricity and travel expenses .

Teacher: Laila Fakhoury


We Will Look At How Batch Processing Is Involved In Producing A Company Payroll.
First, we need to be sure we understand that two separate files are involved in this process.
Teacher: Laila Fakhoury

https://www.youtube.com/watch?v=44fMuzW_e9k

Example:
Payroll System of a company that pays its workers weekly.

Master File
Contains all important data that The transaction file
does not change often such as contains the data that changes each
Name , works number ,
department , hourly late ….etc week, such as hours worked.

1. The master file would already be sorted in order of the key field so that processing is easier to perform.
2. The transaction file would probably be in the order that the transactions were collected.
Before these two files can be processed together to produce the payroll, the transaction file needs to be sorted in the
same order as the master file and will also need to be checked for errors using validation checks.
A master file would be used together with a transaction file in most batch processing applications, including a computerised
When data is stored in order of a key field, it often forms what is called a ‘sequential file’ (Access data types)
These used to be stored on magnetic tapes, but magnetic disks and solid state drives are now used much more than magnetic
tapes, which tend, in modern systems, only to be used for backing up systems. The transaction file will therefore be stored on
disk, even though it holds data in sequential order. When data is searched for in batch processing, each record is looked at
one by one until the computer finds the record it is looking for. This is called sequential access.

There are occasions when the data in a master file has to be updated, for example so that a new worker will get paid. We
will assume that the changes will happen on a weekly basis.

It is likely that the transaction file would contain any needed updates as well as the payroll data and there would only be one
transaction file, but to make it simpler to understand we will assume that the updating of the master file
happens first and then the payroll runs immediately afterwards.

Teacher: Laila Fakhoury


The three types of transaction involved in updating a master file in the scenario we have outlined
are when:

» a worker moves to different department: their record must be amended or changed

» a worker leaves the company: their record needs to be removed or deleted

» a new worker starts with the company: their record needs to be added.

We can give each type of update a letter. Changing an existing record in the master file will be C, whereas deleting a record
from the master file will be D and adding a new record to the master file will be A.

At the end of each week, the computer system will process the data stored in the transaction file and make any
changes that are necessary to the master file, thereby producing an updated master file.

Teacher: Laila Fakhoury


In order to update the master file, a new blank file will
be created and act as the new master file.The following
very basic algorithm will be followed.
Teacher: Laila Fakhoury
Teacher: Laila Fakhoury
What is happening in this algorithm is that the computer reads the first record in the transaction file and the first record
in the old master file. If the ID does not match, as it does not in this case (ID is 2 in the transaction file but the ID in the
master file is 1), there is no change necessary. The computer simply writes the old master file record to the new master
file and misses out the next instructions 6 to 9 (IDs do not match so they can be ignored) then the next record from
master file is read. After the last record, an End of file marker would be stored. As it has not been read yet we cannot be
at the end of the file so the UNTIL statement

tells the algorithm to go back to the REPEAT instruction. It starts again at the ‘IF IDs do not match’ in instruction 5. The IDs
match in this example because the ID is 2 in the transaction file and the ID in the master file record is now 2. Instruction 5 is
therefore ignored and instruction 6 indicates that the transaction is carried out and moves on to instruction 7. In this case the
transaction is D so the record has to be deleted, so the old master file record is not written to the new master file. Instruction
8 is ignored as the transaction is not C. Instruction 9 causes the next record from the transaction file to be read. Instruction 10
means the next record from the master file is read. We again meet the ‘UNTIL end of old master file’ instruction. As the
algorithm has yet to meet the end of file marker, we go back to the REPEAT which is instruction 3. We are now looking at the
second record of the transaction file (ID 4) and the third record of the old master file (ID 3). If they do not match (instruction
5), which they do not, the old master file record is written to the new master file and we jump to instruction 10 and the next
record (the fourth, ID 4) of the old master file is read. We are not at the end of the file, so the algorithm takes us back to
instruction 3 and then on to instruction 4 then instruction 5: the ‘IF IDs do not match’ instruction. However, this master file
record matches with the second record in the transaction file so the transaction is carried out. It is C, so the master file record
is not copied across, instead the record from the transaction file (apart from the C) is copied into the new master file. The next
record from the transaction file is read and then the next record from the master file is read.

Teacher: Laila Fakhoury


This carries on until the EOF marker is met in the old master file. The UNTIL instruction is now true, so the algorithm
moves on to instruction 12 so the current transaction record is written to the master file. Then instruction 13 is followed
and the remaining records of the transaction file are added to the master file, in this case two records. The steps are carried
out as shown, making two assumptions. One is that all additional records will be at the end of the transaction file. This is
usually the case as new employees would be given the next available ID and the transaction file would be sorted so these
new workers would appear at the end of the file. The other assumption, which is not really likely in a real situation, is that
the transaction file records will have fields identical to all those in the master file. To make it easier to follow, we have not
included, for example, the rate of pay field in those records which need to be added, but this field would have to be included
in the master file for every employee.

Teacher: Laila Fakhoury


We can assume that the transaction file
has been sorted and validated. The
system would have to go through each
transaction file record and using the
hourly rate (Rate) from the matching
master file record, calculate that
employee’s wages for the week. This
would be added to the employee’s
wages paid so far this year and replace
the Wages_to_date value. We shall
assume that the workers pay no tax and
have no other deductions.
Teacher: Laila Fakhoury
Teacher: Laila Fakhoury
Teacher: Laila Fakhoury
We have already mentioned that customer orders can be dealt with using batch processing. When a company receives
an order from a customer, it is added to a transaction file. At the end of the day, the transaction file is used together
with a master file to check the items are in stock and to update the master file with the new number of items in stock
after making deductions arising from the orders. If items are not in stock, they must be ordered from a supplier. If they
are in stock, then they are added to what is called a picking list which is sent to the warehouse. The warehouse staff
then find the goods that have been ordered and package them ready for shipment to the customers. The next step is to
allocate the packaged goods to delivery vehicles. At the same time, invoices are produced and sent to customers for
immediate payment or added to their account (if customers make payments every month). Let us look at how account
payments are processed.

The transaction file will contain details of the orders a customer has
made in the last month, together with any payments the customer has
made. We will consider a simple master file which just contains the
money owed by each customer, which is called ‘the balance’.
Teacher: Laila Fakhoury
Again, we can assume that the transaction file is sorted in Cust_no order and has
been validated. The algorithm describing the process would be similar to the
payroll algorithm:

Teacher: Laila Fakhoury


Teacher: Laila Fakhoury
Teacher: Laila Fakhoury

You might also like