3 Main Steps in Data Processing | Programming

This article throws light upon the three main steps in data processing. The steps are: 1. Data Preparation 2. Program Prepara­tion 3. Compiling and Running the Program.

Step # 1. Data Preparation:

The preparation of data is an essential step in data processing since data is to be presented to the computer in a form which it could reckon and be able to manipulate easily to give the result (e.g.), To solve a quadratic equation, say 4x2 – 3x + 5 = 0, the input data should be the values of the coefficients a,b and c (i.e.), 4,-3 and 5 and not the equation.

Steps in Data Preparation:


The following are the steps in the data preparation:

(i) Analysing the system and fixing up the data fields (e.g.). If, in an AC circuit, it is required to find the power factor, the input data fields are to be decided as the values of Voltage, Current and Power.

(ii) Collection of Data: This is done by performing an experiment or survey and taking readings. Or the data can be obtained from some other organisation or department.

(iii) Designing a standard input format: If processing involves a number of sets of readings, each such set is a record. All the records should be of same form, especially if the processing is to be done using Fortran or Cobol. So a standard input format should be designed.


This design will involve the following steps:

(a) Fix up the sequence of fields.

(b) Fix up the length of each field allowing for maximum possible length. While fixing up the length, an extra column or character position should be allowed each for recording the MINUS sign and decimal point.

(c) Write down the configuration of the fields. While doing so, allow for minimum one blank between adjacent fields. (This is not necessary in case of processing with Fortran, since a Format statement is used in the program defining the nature and length of each field in a record. In case of Cobol also, this is not necessary since the data division entries describe the length and nature of each field in the record).


(d) Draw the configuration on a lay-out form.

(e) Mark the length and nature of each field in the input format.

To indicate the nature of each field, certain codes may be used as indicated below:


(iv) Recording Input Data:

After designing the input format, the input fie Ids/readings in each record/line have to be recorded in multiple column sheets according to the format designed.

While so recording:

(a) Numeric fields are to be entered right justified

(b) String fields are to be entered left justified, and

(c) One line should contain only one record or one set of readings and one column one character only.

The input format is used as reference material for recording data in a uniform format in all records as also for writing format statements, if any, in the program.

(v) Data Entry:

The data “recorded in multi-column is entered on a floppy disk through a key-board or punched on cards with one card per record.

Example 8.1:

About 100 quadratic equations in the form Ax2 + Bx + C = 0 are to be solved using the computer. The maximum value of any coefficient is 438.87 and minimum value is —284.92. Design the format of the input record.


(1) Fix up the input fields. The input will be values of coefficients A,B and C.

(2) Fix up their sequence. The sequence will be A, B and then C.

(3) Fix up the length of each field.

The maximum length will be that of —284.92 (i.e.) 7 character positions inclusive of the negative sign and the decimal point. So each variable A or B or C can be allocated 7 character length.

(4) Write down their configuration:

(5) Draw the configuration on layout form and give the field description (i.e.) length and nature of each field (Fig. 8.1).

Input Record Format

(6) Verification: The data entered is verified line by line/record by record, using the data recorded in multiple column sheet as reference and errors, if any, in transcription are corrected.

(7) Sort the data records and arrange in an order.

Step # 2. Program Preparation:

Program is a set of unambiguous instructions given in proper sequence to get a problem solved through the computer.

The program preparation involves the following steps:

(i) Getting the input format or preparing it, if it is not already there. The input format is essential to name the fields in the input (read) instruction in the order they occur from left to right in the input record.

(ii) Preparation of Output Format: This would be essential to write the output (write) instruction as also to get the result displayed in an easily readable and well-presentable form.

The output may be mostly displayed on the screen or got as a print-out.

The steps for designing the format of output will be more or less similar to the input-formats.

The steps will be:

(a) Fix up the fields to be displayed;

(b) Fix up their sequence;

(c) Fix up the length of each field, allowing for maximum possible length;

(d) Write down their configuration. Allow a few blanks between adjacent fields to provide better readability. Also center the data to be displayed by allowing more or less equal number of blanks on its either side, and

(e) Write down the field descriptions.

The following problem will illustrate the above procedure.

Example 8.2:

Design the output format for the problem given in 8.1. the output will be on an 80 column screen or an 80 column print-out.


(1) Fix up the fields: The fields in the input record, namely, A,B and C, are to be given in the output record also.

Besides them, the roots xx and x2 have to be displayed. In case of imaginary roots, both x1 and x2 will have 2 components, namely, ‘real part’, say X1 R,X2R and the ‘imaginary part’, say X1l and X2I, respectively. For uniformity’s sake, these 4 fields will be provided in all cases. In case of real roots, the imaginary components X1I and X2I will be recorded as 0.

(2) Fix up the sequence of fields. The sequence will be A, B, C, X1R, X1I, X2R, X2I.

(3) Fix up length of each field: The lengths of A, B and C will be same as in the input record (ie) 7 characters.

The lengths and nature of X1R, X1I, X2R and X2I can be assumed to be same as A or B or C.

(4) Write down their configuration allowing for a few blanks between adjacent fields. Also centre the data to be printed.

(5) Draw the Format in the output layout from and enter the field descriptions (refer fig 8.2)

Output Record Format

(iii) Fix Up The Numerical Method or The Logic of Solution to the Problem:

In most cases, the computer method of solution will be different from the methods used in manual solution. For example, the GCD (greatest common divisor) of any 2 integer numbers, say, M and N, has to be computed using the following steps:

Step 1:

Check whether M = N. If so, GCD = M = N.

Step 2:

Else, if M > N, then make M = M – N and go to Step 1.

Step 3:

Else, make N = N – M and go to Step 1. (e.g.,)

In case M = 35, N = 25, the above steps will be executed on them as follows:

Since M = N now, the iteration will stop here.

GCD = M = N = 5.

(iv) Write Down the Algorithm and/or Draw The Flow-Chart:

An Algorithm is an unambiguous ordered sequence of steps in all details that leads to the solution of a given problem.

The algorithm incorporating the above numerical method will be as follows: Algorithm GCD (Given 2 integer numbers M and N, to find their GCD).

Step 1:

(Get input data) READ (M, N)

Step 2:

If M = N, then Go to Step 5

Step 3:


If M ← N, then Set M ←M – N Go to Step 2

Step 4:

Else (of N > M) Set N ← N – M Go to Step 2

Step 5:

Set GCD — M

Step 6:

(output the result)

Write (GCD)

Step 7:

(Finished) Exit

Statements written within brackets in the algorithm are explanatory comments.

Instead of writing the solution steps in the form of an algorithm, they can be drawn in the form of a flow-chart. A flow-chart is sometimes called a block-diagram. It is a graphical form of the algorithm.

A flow-chart consists of a number of BOXES or BLOCKS each of which represents an operation. The sequence of operations is indicated by the directed lines connecting the boxes.

The several kinds of symbols on boxes used in flow-charts are as follows (Fig. 8.3).

The algorithms GCD can be drawn in the form of a flow- chart as follows: (Fig 8.4)

(v) Fix up The Programming Language:

The user’s programs are written in what are called high level languages. The choice of one among them depends upon the problem to be solved. For scientific and technical problems, FORTRAN is preferred. For business problems, COBOL is preferable. BASIC and PASCAL are capable of processing both technical and business problems.

(vi) Coding the Program:

When once the appropriate programming language is chosen, the program is written in that language, using input/output formats and the algorithm or flow-chart as reference. Coding means writing the detailed procedure to solve a problem, in a computer language.

(vi) Entering the Program:

Coding of the program is done in special coding sheets in case of COBOL and FORTRAN or in any ordinary sheets in case of other languages. It is then entered through the key-board in a floppy disk or punched on cards using the off-line punching machine.

(vii) Verifying the Program Entered:

The program entered in an input medium like floppy disk or card will be verified for any transcription errors and errors, if any, are corrected.

The transcription errors are:

(a) Insertion of an extra character,

(b) Omission of a character,

(c) Using incorrect character, and

(d) Transposition of 2 adjacent characters.

The verified and corrected program is called the source program.

Step # 3. Compiling and Running the Program:

The computer can operate only on instructions in a coded form which is called machine code or machine language. But writing the program in the machine language is very difficult for a user or programmer. A programmer always makes use of an easier language like FORTRAN, PASCAL, BASIC and COBOL to write the program. Such languages are called high-level languages.

A source program in such a high level language is to be translated into a program in the machine language to be executed by the computer. For this, a translator program called COMPILER is to be used.

Using a Fortran-Compiler, which may be on tape or disk, the source program in Fortran is translated into Machine code. This process is called compilation. The computer is to be used for Compilation (Fig. 8.5). The output program from compilation is called the object program.

The object program may be got on a floppy disk. Besides giving the object program, the computer gives an output on the screen or on the printer, which is called the prelist, or the listing.

The prelist contains the source program, with errors in syntax, if any, being pointed out. (It should be noted here, logical errors, if any, will not be pointed out). The small errors in syntax are called bugs. These have to be removed. This removal is called debugging.


Debugging is done on source program and compilation is done again. This may have to be repeated until prelist indicates ‘NIL’ error.

When once an error-free object program is obtained, it is loaded into the memory. This process of storing a program in the computer memory and making the computer execute it is called the ‘stored program concept.’

If a program is to be run for the first time, it is tested with same hypothetical records or data. This is to check whether the logic in the program is correct and it is called the program check-out.

If this check gives correct results, the object program is used to process the actual data records. Else, the source program is altered suitably, compiled and tested again.

For running the program with test data or actual data records, the object program is loaded and stored in the memory and the input data is given to the computer. The computer executes the instructions in the program on the input data and displays the result on a screen or prints on a paper (Fig. 8.6).

, , ,

Comments are closed.