What is COBOL?

The 60-year-old programming language that powers a huge slice of the world’s most critical business systems needs programmers


COBOL is a high-level programming language for business applications. It was the first popular language designed to be operating system-agnostic and is still in use in many financial and business applications today.


The development of the language was a project sponsored by the United States Department of Defense (DoD) that included a consortium of computer companies including IBM, Honeywell, Sperry Rand, and Burroughs. The goal was to create a programming language with the following attributes:

  • Portability between computer systems, thus making it easier to migrate software both across generations of hardware and between hardware makers.

  • More English-like syntax than other languages of the time (e.g., FORTRAN) as a way to encourage programming by a wider audience, even if at the expense of some operational speed.

  • The ability to accommodate future changes to the language.

The first official COBOL specifications came out in 1960. Over the next decade, and to the consternation of its critics, COBOL became the default choice for writing business applications. One reason for its fast spread was network effects: IBM, one of the original collaborators on the language, became an aggressive early adopter, and IBM’s dominating presence in the computing world helped contribute to COBOL adoption.


COBOL language

The designers of COBOL broke with the terse syntax of other programming languages at the time (again, such as FORTRAN). The idea was to create a programming language that could be read and understood by non-programmers, particularly accounting, finance, insurance, and other business professionals.

Consider a “hello world” program written in an early dialect of COBOL:

IDENTIFICATION DIVISION.
PROGRAM-ID. HELLO-WORLD.
 
PROCEDURE DIVISION.
DISPLAY 'Hello World!'.
END-DISPLAY.
STOP RUN.

For modern software developers reared on the terseness of languages like Python, this code is verbose. But the verbosity of COBOL (if not its execution) springs from the same conceit that informs modern languages like Python — that code is read many more times than it’s written, so it should be written to be readable.


A similar program in a more modern version of COBOL might look something like this:

program-id. hello.
procedure division.
    display "Hello world!".
    stop run.

While this example is more concise, the same basic principles apply: The code strives to be explicit about what’s going on at each step.


COBOL has strict rules regarding syntax and the internal organization of programs. A COBOL program is explicitly divided into sections, or divisions, that make it easier to locate and understand its components at a glance:

  • Identification division: Essentially a metadata section, containing details about the program, its author, and so on.

  • Environment division: Contains details about the runtime environment, for instance aliases for external devices, which might need editing when running the program on different hardware. This aided portability of a program between systems, where for instance I/O might be handled entirely differently.

  • Data division: Containing file and working storage sections, the Data division describes the files and variables (respectively) used in the program.

  • Procedure division: The actual program code lives here, broken into logical units called sections, paragraphs, sentences, and statements. It’s tempting to analogize these structures to modules or functions, because they serve roughly the same functions (dividing code into blocks, with constrained inputs and outputs) but they are far less flexible.

COBOL also has extremely strict formatting rules for the code, down to the number of spaces preceding a command. (Python users will find this familiar!) Some of these restrictions are a by-product of COBOL’s coming-of-age during the mainframe era of the 1960s, when programs were encoded on punched cards and the exact formatting of 80-column lines mattered. But other formatting restrictions enforce readability.


The idea behind the strict regimentation of COBOL programs is to make them as self-documenting as possible. After all, COBOL programs tended to remain in place for years or decades on end. The intent (if not always the end result) was to make every COBOL program an artifact that any COBOL programmer could understand, even years later, without the help of the programmer who created it.


COBOL features

Popular features of COBOL include:

  • Simplicity and standardization. COBOL is an easy-to-learn, standard language that can be compiled and executed on a variety of computers. It supports a wide syntax vocabulary and features an uncluttered coding style.

  • Business-oriented capabilities. COBOL’s advanced file handling capabilities enable it to handle huge volumes of data. COBOL still handles more than 70% of the world’s business transactions. COBOL is suited for everything from simple batch reporting to complex transactions.

  • Universality. COBOL has adapted to six decades of business change and works across numerous platforms and devices. The language offers debugging and testing tools for almost all computer platforms, and new COBOL products, compilers and development tools continue to be announced every year.

  • Structure and scalability. The logical control structures available in COBOL make it easy to read, modify and debug. COBOL is also scalable, reliable and portable across platforms.


Advantages :

  1. It's easy to read. Its high-level English-like syntax can resemble a well-structured novel with appendices, cross-reference tables, chapters, footnotes and paragraphs.

  2. It is self-documenting and appeals to proponents of readability.

  3. It can handle huge processing volumes with ease.

  4. It's still widely used for business applications, which is an area it excels at. COBOL is relatively easy to develop, use, and maintain.

Disadvantages :

  1. It is sometime necessary for a COBOL programmer to have a knowledge of machine language code, for if diagnostics do not produce a clue as necessary to look at a "CORE DUMP'. Thus the COBOL programmer may be required to have a proficiency in two programming languages.

  2. The time required to compile a COBOL program might be greater than with a machine oriented programming language.


Source: Wikipedia , TechTarget.com


The Tech Platform

www.thetechplatform.com


0 comments