INTRODUCTION TO COBOL



To effectively use a computer System as a tool for the solution of scientific and business problems. It was recognized that there was a need for `high-level' programming languages, that is, programming languages that were not machine oriented.

In 1957, IBM (International Business Machines) released the specifications for a high-level scientific oriented language called FORTRAN (FORmula TRANslation). This programming language substantially relieved the uses from a detailed knowledge of the internal operations of an electronic data processing system, and allowed the programmer to define the input to be processed, the calculations to be performed and the output to be produced in a format for removed from the internal operation of the computer.

It was soon recognized that there was also a need for a `high-level' business oriented language. On may 28 of 1959 a meeting was called by the department of defence, at the suggestion of a small group of computer users, manufacturers, and universities to discuss the problem of developing a common business language for computers. This original committee meeting was called CODASYL (Conference on Data System Language). The purpose of this conference was to consider the both the desirability and feasibility of establishing a common language for use by all manufacturers of electronic data processing systems. There was almost unanimous agreement that the project was both desirable and feasible. A short range committee was established and composed of representatives from six manufacturers RCA, Remington Rand and Sylvania Electric Products), two Government agenIt was soon recognized that there was also a need for a `high-level' business oriented language. On may 28 of 1959 a meeting was called by the department of defence, at the suggestion of a small group of computer users, manufacturers, and universities to discuss the problem of developing a common business language for computers. This original committee meeting was called CODASYL (Conference on Data System Language). The purpose of this conference was to consider the both the desirability and feasibility of establishing a common language for use by all manufacturers of electronic data processing systems. There was almost unanimous agreement that the project was both desirable and feasible. A short range committee was established and composed of representatives from six manufacturers (Burroughs, IBM, Honerywell, cies. The Air Material Command, and Department of Navy, in addition to a representative from the Bureau of Standard.

The first specification for this new programming language called COBOL (Common Business Oriented Language) were released in April 1960. Since that time a number of revisions and addition have been made to original specification.It is interesting to note that this was the first attempt to develop a common programming language in which there was cooperation of a group of competing manufacturers of computer system, thus COBOL is only language developed through the cooperative efforts of various manufacturers within the data processing industry. Today COBOL, is one of the dominate programming language used for the solution of business problems.The purpose of COBOL was to provide a Common Business Oriented Language. The word common was interpreted to mean that the programming language was to be compatible among a significant group of manufacturers. In addition a basic objective was that the language was to be natural, where natural was defined as `English-like'. COBOL was not designed to permit concise writing, on a contrary, the language is very `wordy' however, the benefit gained from this is the increased readability of the programs and the `built-in' documentation because of the readability of the language.


Top of the Page


IDENTIFICATION DIVISION.
PROGRAM-ID. IND-SEQ.
ENVIRONMENT DIVISION.
CONFIGURATION SECTION.
SOURCE-COMPUTER. IBM.
OBJECT-COMPUTER. IBM.
INPUT-OUTPUT SECTION.
FILE-CONTROL.
SELECT SOURCE-FILE ASSIGN TO RANDOM "STRT"
ORGANIZATION IS INDEXED
ACCESS MODE IS DYNAMIC
RECORD KEY IS RLN
ALTERNATE RECORD KEY IS NME WITH DUPLICATES.
DATA DIVISION.
FILE SECTION.
FD
SOURCE-FILE LABEL RECORDS ARE STANDARD.
01
S-REC.
02 RLN PIC X(4).
02 NME PIC X(10).
02 BWN PIC X(10).
WORKING-STORAGE SECTION.
01
CONT1 PIC X VALUE SPACES.
01
I PIC 9(2) VALUE 12.
01
NYY PIC X(10) VALUE SPACES.
PROCEDURE DIVISION.
BEG.
OPEN OUTPUT SOURCE-FILE.
ACPT.
DISPLAY " " ERASE
DISPLAY " ENTRE STUDENT'S ROLL NO: "LINE 10 POSITION 20
DISPLAY " ENTRE STUDENT'S NAME : "LINE 11 POSITION 20
DISPLAY " ENTRE BOOK WRITTEN : "LINE 10 POSITION 20
DISPLAY " DO YOU WAN TO ENTER MORE RECORDS (Y/N)"LINE 13 POSITION 20.
ACCEPT RLN LINE 10 POSITION 49.
ACCEPT NME LINE 11 POSITION 49.
ACCEPT BWN LINE 12 POSITION 49.
ACCEPT CONT1 LINE 13 POSITION 63.
IF CONT1 = "Y" GO TO ACPT.
CL-1.
CLOSE SOURCE-FILE.
MRTN.
OPEN INPUT SOURCE-FILE.
DISPLAY " " ERASE.
RTR.
DISPLAY "ENTER THE NAME YOU WANT TO ACCESS" LINE 15 POSITION 20.
ACCEPT NYY LINE 15 POSITION 69.
MOVE NYY TO NME.
START SOURCE-FILE INVALID KEY DISPLAY "ERROR"
GO TO RTR.
READ1.
DISPLAY " " ERASE.
DISPLAY " ROLL- NO. " LINE 10 POSITION 10.
DISPLAY " NAME " LINE 10 POSITION 30.
DISPLAY " BOOK WRITTEN " LINE 10 POSITION 60.
READ2.
READ SOURCE-FILE NEXT RECORD INVALID KEY DISPLAY "TYPE THE CORRECT KEY"
GO TO CLO.
IF NME = NYY NEXT SENTENCE ELSE GO TO CLO.
COMPUTE I = 1 + I.
IF I > 23 STOP "LINE OVERFLOW" GO TO CLO.
DISPLAY RLN LINE I POSITION 10.
DISPLAY NME LINE I POSITION 30.
DISPLAY BWN LINE I POSITION 60.
GO TO READ2.
CLO.
CLOSE SOURCE-FILE.
STOP RUN.

COBOL SOFTWARE USAGES

Software Names

Computer Names

Microsoft COBOL (MS Cobol)Micro Computers
RM COBOL (RM Cobol)Mini-Systems like NCR, VRX, etc.
VRX COBOL
VSE COBOL
VAX/VAM COBOL
Large/Main computers

Top of the Page


COBOL ADVANTAGES

Using COBOL to code source programmes that some decided adv-antages when compared to `machine/oriented' programming languages. They are:
  1. The programmer's attention is concentrated on the problem rather than on the hardware characteristics of the machine used. Thus a detailed knowledge of the object language instruction set, relative addressing and other machine oriented subjects is not normally needed by the COBOL programmer.
  2. COBOL is comparatively easy to learn because the notation is problem oriented, the actual program is generally easier to write. An additional advantage is that once written the program is to a great extent self-documenting and thus easy to maintain.
  3. A problem written in COBOL is generally easier to correct or `debug' than one written in a symbolic assembler type language. The diagnostics which the COBOL compiler performs on the source program provides the programmer with an automatic check of Accuracy of much of his coding.
  4. An important consideration in the selection of programming language is the case of conversion from one computer to another. Because COBOL was developed faintly by a number of the major manufacturers, it tends to be one of the most widely used programming languages with a high degree of compatibility among different computing systems.
  5. An important advantage to a high level programming language is that it usually reduces the total amount of programming time required in the solution of typical problems. Typically it is faster to program in a high level language than to program in a machine oriented language.

COBOL DISADVANTAGES

  1. It is sometime necessary for a COBOLprogrammer to have a knowledge of machine language code, for if diagonostics 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.

History of COBOL is started from 1960

COBOL (at different periods of times) stood for:

** Compiler Oriented Basic Organized Listing --->by 1957

** COmmon Bargain Oriented Language

** COmmon Business Oriented Language ---> 1960.

It was interpreted to mean that the programming language was to be competable among significant group of manufacturers or means natural language like English.


Top of the Page