Tuesday, March 19, 2013

Batch Processing

Batch Processing

A batch processing system is one where programs and data are collected together in a batch before processing starts. Each piece of work for the computer to do is called a job. Often a job just consists of a program to be run and the data for it. A job queue is a number of jobs waiting to be processed.


1 Jobs are stored in job queues until the computer is ready to deal with them.

2 There is no interaction between the user and the computer while the program is being run. Computers which do batch processing often operate all night so the user might be at home asleep.

3 Batch processing is often used where a large amount of data has to be processed on a regular

basis. The program is not changed and it is so routine that there is no need for anyone to be present while the program is running.

4 Batch processing is normally done on large mainframe computers.

The following is a typical way of preparing and running batch jobs (see also Fig 2):

1 The user writes out what has to be done on pre-printed sheets.

2 A keyboard operator prepares and verifies the work by key-to-disc or key-to-tape.

3 The job is put together with other jobs and input to the computer.

4 The job waits in a queue and is then processed.

5 The output is stored on disc (or 'spooled') and then printed later.

6 The printout is returned to the user.

Batch Processing

Fig 2 Example of a batch processing system (system flowchart). In this example jobs are keyed onto magnetic tape and discs are used for spooling work before and after processing

Examples where batch processing would be used

1 A weekly payroll run (see Fig 3 for system flowchart).

2 A run at a Gas Board to produce bills for customers. The input data is a batch of meter reading slips completed in pencil by the meter reader and accompanied by a batch header.

3 An updating run in which a transaction me is used to update a master file (see Fig1).

4 A programmer developing a batch program edits it on-line at a terminal and then uses the terminal to submit the program into a batch job queue.

Advantages and disadvantages of batch processing


1 There is no need for the user to be present when the job is run.

2 Preparing the work and operating the computer are done by trained people and not by the user.

3 Less expensive than time-sharing on large systems.


1 There is always a delay before work is processed and returned.

2 The user cannot take action if anything is wrong-he has to re-input the job.

3 Batch processing usually involves an expensive computer and a large staff.


Large computers used for batch processing often employ a technique known as multi programming.

Multiprogramming is a process which enables two or more jobs to run, apparently at the same time. In fact, the computer can only execute one program at a time. It actually switches between jobs giving each in turn a short burst of activity.

The purpose of multiprogramming is to make good use of the processor, the store and the peripherals.

The operating system chooses programs from the job queue which are suitable to run together. For example, running the following programs together would keep the processor, its main store, a disc unit, an input device and a printer all in action:

Program 1 does long calculations on large arrays mainly using the main store and the processor.

Program 2 merges two files of names using mainly a disc unit.

Program 3 inputs a large list of customers and prints out bills using mainly an input device and a printer.

If these programs were run one after another, only part of the computer would be busy each time. If they are run together, all parts of the computer are in use. The three jobs are finished more quickly than if they were run one after another. (See Fig 3)

Batch Processing2

Fig 3 Multiprogramming-use . of resources by programs 1,2,3