COBOL, or Common Business-Oriented Language, is a high-level computer programming language that was one of the earliest widely used languages and was the most popular language in the business industry for many years. It sprang out of the 1959 Conference on Data Systems Languages, which was a combined US government-private sector endeavour. COBOL was intended to achieve two key goals: portability (the ability to run programmes on machines from several manufacturers with minimal change) and readability (ease with which a programme can be read like ordinary English).
Brief History:
When enterprises in the western world grew in the 1950s, there was a need to automate numerous procedures for ease of operation, which led to the development of a high-level programming language for commercial data processing.
- COBOL was created by CODASYL in 1959. (Conference on Data Systems Language).
- COBOL-61, the following version, was published in 1961 with several changes.
- COBOL was accepted as a standard language for commercial usage by ANSI in 1968. (COBOL-68).
- COBOL-74 and COBOL-85 were developed when it was rewritten again in 1974 and 1985, respectively.
- In 2002, Object-Oriented COBOL was launched, allowing COBOL programmers to use encapsulated objects as part of their usual workflow.
- COBOL, in2014 includes features such as method overloading, dynamic capacity tables, and more.
Importance of COBOL:
- The first widely used high-level programming language was COBOL. It’s an easy-to-understand English-like language. All of the instructions may be written in plain English.
- COBOL is also a self-documenting programming language.
- COBOL is capable of handling large amounts of data.
- COBOL is backwards compatible with earlier versions.
- COBOL offers good error messages, which makes bug resolution easier.
File extensions:
- COBOL Source File – When you load this file into the COBOL editor, it is syntax coloured, background parsed, and compiled using the COBOL compiler. The extensions .cbl and .cob are the defaults.
- COBOL Copybook – when imported into the COBOL editor, this file is syntax coloured and optionally background processed. .cbl and .cpy are the default extensions.
Syntax of COBOL:
The syntax of COBOL is similar to that of English, and it is used to describe practically everything in the programm.
A condition expression, for example, can be written as:
x is GREATER THAN y
COBOL includes around 300 reserved terms in order to have such an English-like syntax. Some keywords are singular, while others are plurals, such as VALUE and VALUES.
Code Format:
- Each line of a COBOL programme contains 80 characters.
- The compiler ignores the first six letters, which are used for card/line numbers.
- The Indicator area is the seventh character, and it defines a continuation with a ‘–’ OR comment with a ‘* or /’.
- AREA A: The DIVISION, SECTION, and process headings are included in the following four characters (8-11).
- Columns 12-72 in AREA B include any code that is not permitted in AREA A.
- The programme name area (columns 73-80) is used to identify the programme.
Variable Declaration:
- In COBOL, a variable is a designated memory region that a programme may use to store data and retrieve data from.
- In DATA DIVISION, each variable must be stated.
- It can be up to 30 characters long.
- The initial character must be a letter, and it can be alpha-numeric.
Applications of COBOL:
- COBOL is a programming language that is commonly used in space applications.
- COBOL is a programming language that is used in company and government commercial and administrative systems. COBOL is a programming language that is used in mainframe applications.
- COBOL is mostly utilized in batch and online transaction processing (OLTP) activities on a big scale.
- There are larger programmes in Batch that deal with a huge number of records. This is the read-modify-write loop that many COBOL programmes employ. The Transaction
- Processing monitors inside which the programmes are written and run execute them in parallel in OLTP.
Advantages:
- COBOL is a self-documenting language.
- It is written in an ENGLISH-like style, making it simple to grasp and read.
- It can readily manage large amounts of data.
- It’s commonly used in commercial applications and administrations, and it’s simple to keep up with.
Disadvantages:
- A strong understanding of machine languages is required to become a COBOL programmer.
- Because the language is similar to English, it necessitates a lot of typing, which makes the code thick.
- A COBOL programme takes longer to compile than other machine programming languages.
- It adheres to a rigid coding format.
The quantity of experienced COBOL programmers has decreased.
Conclusion:
Common Business Oriented Language (COBOL) is a shorthand for Common Business Oriented Language. It’s procedural, imperative, and object-oriented. A compiler is computer software that converts other computer programmes written in a high-level (source) language into machine code, which the computer can comprehend. COBOL is a programming language that reads data from a file or database, processes it, and then outputs it. In a nutshell, COBOL accepts input, computes it, and then outputs it.