You are on page 1of 2

The U.S.

government offered encouragement by insisting that anyone attempting to


win government contracts for computer-related projects had to use COBOL. The
American National Standards Institute first standardized COBOL in 1968 and, in
1974, issued standards for another version known as ANSI-COBOL. After more than
seven controversial years of industry debate, the standard known as COBOL 85 was
approved, making COBOL a more usable modern-day software tool. The principal
benefit of standardization is that COBOL is relatively machine independent- that is, a
program written for one type of computer can be run with only slight modifications on
another type for which a COBOL compiler has been developed.

COBOL is very good for processing large files and performing relatively simple
business calculations, such as payroll or interest. A noteworthy feature of COBOL is
that it is English-like-far more so than FORTRAN or BASIC. The variable names are
set up in such a way that, even if you know nothing about programming, you can still
understand what the program does. For example:
IF SALES-AMOUNT IS GREATER THAN SALES-QUOTA
COMPUTE COMMISSION = MAX-RATE * SALES-AMOUNT
ELSE
COMPUTE COMMISSION = MIN-RATE * SALES-AMOUNT.

Once you understand programming principles, it is not too difficult to add COBOL to
your repertoire. COBOL can be used for just about any task related to business
programming; indeed, it is especially suited to processing alphanumeric data such as
street addresses, purchased items, and dollar amounts-the data of business. However,
the feature that makes COBOL so useful-its English-like appearance and easy
readability-is also a weakness because a COBOL program can be incredibly verbose.
A programmer seldom knocks out a quick COBOL program. In fact, there is hardly
such a thing as a quick COBOL program; there are just too many program lines to
write, even to accomplish a simple task. For speed and simplicity, BASIC,
FORTRAN, and Pascal are probably better bets.

As you can see in Figure 6, a COBOL program is divided into four parts called
divisions. The identification division identifies the program by name and often
contains helpful comments as well. The environment division describes the computer
on which the program will be compiled and executed. It also relates each file of the
program to the specific physical device, such as the tape drive or printer, that will read
or write the file. The data division contains details about the data processed by the
program, such as type of characters (whether numeric or alphanumeric), number of
characters, and placement of decimal points. The procedure division contains the
statements that give the computer specific instructions to carry out the logic of the
program.
It has been fashionable for some time to criticize COBOL: It is old-fashioned,
cumbersome, and inelegant. In fact, some companies, devoted to fast, nimble program
development, are converting to the more trendy language C. But COBOL, with more
than 30 years of staying power, is still famous for its clear code, which is easy to read
and debug.

You might also like