You are on page 1of 13

COBOL PROGRAMMING LANGUAGE

OUTLINE:

HISTORY OF COBOL

PROGRAMMING DOMAIN OF COBOL

MAJOR FEATURES OF COBOL

CRITERIA EVALUATION OF COBOL

SAMPLE PROGRAM OF COBOL

PARADIGMS OF COBOL

STRENGTH AND WEAKNESS OF COBOL


WHAT IS COBOL?

COBOL(common business-oriented language)

- is a standard programming language developed by a consortium CODASYL


(Conference/Committee on Data Systems Language) in 1959 to support business and financial
applications.

- is a user-friendly language that uses English words and phrases as a syntax of keywords and
constructs.

- was created by Grace Murray Hopper (1906-1992), also known as “the first hacker in history”
and the creator of the first compiler in history.

- is one of the oldest and most historic programming languages.

- It was designed for commercial and business applications and became the standard in the
business world in the 60s and 70s.

History of COBOL

In 1959, COBOL-60 was developed by the Conference on Data Systems Language (CODASYL).
IBM announced that COBOL would be their primary development language in 1962. A standardized
version of COBOL was approved by American National Standards Institute (ANSI) for
commercial use in 1968. By 1970, COBOL had become the most widely used programming
language in the world.

Today, COBOL is still commonly used at financial institutions and by government agencies. Even
though the number of programmers with COBOL experience steadily decreases as those who
learned COBOL while it was popular enter retirement age, COBOL is once again being taught in
some universities -- this time to support application modernization and the DevOps movement. The
increased demand for COBOL programmers has led to increased compensation in this area and
innovative training offers. Over the past decade, IBM has educated more than 150,000 developers on
COBOL and mainframe skills through fellowships and training programs.

While many organizations still use COBOL and training is on the rise, the lack of skills and
burdensome text-based code is beginning to be replaced or integrated with more modern coding
languages, such as Java, .NET, and C++. This can be a complicated and costly process, as these
programs are often run on legacy mainframes that are difficult to replace, and because of the sheer
amount of code still in use. In fact, as many as 75% of rewrite projects on legacy COBOL systems fail
due to cost, time and difficulty

Before the inception of COBOL, each operating system had a programming language of its own.
However, this seemed to be a hurdle for several companies as they had to work with the systems of
numerous brands. This led to the initiation of the COBOL project. The portable framework and
usability made COBOL popular across disciplines such as banks, financial institutions, insurance
companies, human resources departments, and government agencies.

Since the 1950s, COBOL has had several versions; COBOL 60 being the first one, followed by
COBOL 61, COBOL 65, COBOL 68, COBOL 74, COBOL 85, COBOL 2002, and the latest COBOL
2014. Although COBOL has ended its development, its programs are still in use and may continue to
exist until the software is ready to migrate to a new alternative.
PROGRAMMING DOMAIN OF COBOL

COBOL is primarily used in the domain of business and finace.it was designed for processing large

volumes of data , making it well-suited for task such as:

1. Mainframe System - COBOL is often used in legacy mainframe system for task like batch

processing, transaction processing, and data manipulation.

2. Financial and Banking – many bank and financial institutions rely on COBOL for their core

processing system, including handling transactions, customer accounts, and financial

calculation.

3. Government – COBOL is used in various government agencies for administrative and data

processing task , such as managing tax records, social security systems, and cencus data.

4. Insurance – The insurance industry uses COBOL for policy management, claims processing,

and actuarial calculations due to its robust data handling capabilities.

5. Retail – Some retail companies employ COBOL for inventory management, sales reporting,

and supply chain operations.

6. Healthcare – Healthcare organizations may use COBOL in systems for managing patient

records, billing, and insurance claims.

7. Transportation – airlines and transportation companies utilize COBOL for reservation

systems, ticketing, and logistical operations.

8. Legacy Systems – Many organizations still maintain legacy COBOL systems, and

programmers with COBOL expertise are needed to maintain and modernize these systems.
MAJOR FEATURES OF COBOL

Global business language

-Several large enterprises, organizations, banks, financial firms, insurers, and industrial sectors such
as healthcare, retail, automotive, shipping services, and others use COBOL for various reasons.

- Despite the lesser developments in its versions, COBOL remains the language of choice across
diverse markets and business lines.

Easy readability

- COBOL came into existence with the motto of developing a language that communicates better with
computers. However, people observed that the demand for the language grew across industries with
time.

- It allows a layperson to learn and work with the language with proper training.

- Moreover, the language does not use pointers, user-defined data types or functions, making it a
simple language to understand.

Seamless integration with modern systems

- COBOL is a legacy language that supports and integrates easily with most traditional deployments,

architectures, modern technologies, and complex applications.

- with the rise in Service-Oriented Architectures (SOA), REST, and Web Services, new protocols and

methods have come to the fore, including XML, HTML, WSDL, JSON, and SOAP. However, COBOL
has ensured that the language integrates and connects seamlessly with modern applications and

expands its functionality to the web, mobile, and cloud .

Portable language

- COBOL programs run on different platforms. This allows the programmer community to develop

value applications rather than worrying about compatibility with operating systems.

-The platform-agnostic aspect also allows developers to build, test, and deploy COBOL programs

across various supported platforms, thereby speeding up the development and application execution

process

Evolving language

- COBOL software uses standard IDEs that are prevalent in most industries.

- COBOL’s adaptive and evolving nature has allowed the language to stand the test of time and
merge with modern APIs, micro services, and cloud applications.
PROGRAM SAMPLE OF COBOL

IDENTIFICATION DIVISION.
PROGRAM-ID. CalculateAverage.
AUTHOR. YourName.
DATE-WRITTEN. September 11, 2023.

DATA DIVISION.
WORKING-STORAGE SECTION.
01 NUM1 PIC 9(3) VALUE 85.
01 NUM2 PIC 9(3) VALUE 90.
01 NUM3 PIC 9(3) VALUE 78.
01 AVERAGE PIC 9(3)V9(2).

PROCEDURE DIVISION.
COMPUTE AVERAGE = (NUM1 + NUM2 + NUM3) / 3.
DISPLAY 'Average: ' AVERAGE.
STOP RUN.

Explanation:

1. IDENTIFICATION DIVISION: This section contains meta-information about the program, such as the program's name,
author, and date written, just like in the previous example.

2. DATA DIVISION: This division defines the data used in the program. In this program, we have a "WORKING-STORAGE
SECTION" where we declare data items:

- NUM1, NUM2, and NUM3 are numeric variables (PIC 9(3)) with initial values representing three test scores (85, 90, and
78).
- AVERAGE is a numeric variable (PIC 9(3)V9(2)) used to store the calculated average, allowing for two decimal places.

3. PROCEDURE DIVISION: This is the main part of the program where the actual instructions are written.

- COMPUTE AVERAGE = (NUM1 + NUM2 + NUM3) / 3.: This statement calculates the average of the three test scores by
adding them and dividing by 3. The result is stored in the AVERAGE variable.

- DISPLAY 'Average: ' AVERAGE.: This statement displays the calculated average along with the text "Average: " on the
screen.

- STOP RUN.: This statement terminates the program execution.

When you run this COBOL program, it will calculate the average of the three test scores (85, 90, and 78), display
"Average: 84.33" on the screen, and then exit.

This program demonstrates basic arithmetic operations and the use of variables in COBOL for performing calculations
and displaying results. COBOL is often used in financial and business applications where numeric computations are
common.
PARADIGMS OF COBOL
Procedural- Procedural Programming can be defined as a programming model which is derived
from structured programming, based upon the concept of calling procedure. Procedures, also
known as routines, subroutines or functions, simply consist of a series of computational steps to be
carried out. During a program’s execution, any given procedure might be called at any point,
including by other procedures or itself.
Imperative- Imperative programming is a software development paradigm where functions are
implicitly coded in every step required to solve a problem. In imperative programming, every
operation is coded and the code itself specifies how the problem is to be solved, which means that
pre-coded models are not called on
Object-oriented- Object-oriented programming can be defined as a programming model which is
based upon the concept of objects. Objects contain data in the form of attributes and code in the
form of methods. In object-oriented programming, computer programs are designed using the
concept of objects that interact with the real world. Object-oriented programming languages are
various but the most popular ones are class-based, meaning that objects are instances of classes,
which also determine their types.
Generic- Generic programming is a style of computer programming in which algorithms are written
in terms of types to-be-specified-later that are then instantiated when needed for specific types
provided as parameters.
PARADIGMS OF COBOL

PROCEDURAL
IMPERATIVE
OBJECT – ORIENTED
GENERIC

STRENGTH AND WEAKNESS OF COBOL

STRENGTH

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.
its longevity, reliability, and readability,

WEAKNESS

has limitations,
limited functionality
difficulty in maintenance
an aging workforce.
Criteria of Evaluating In COBOL
When evaluating the COBOL programming language, you should consider various criteria that are
relevant to your specific project or requirements. Here are some key criteria and explanations for
evaluating COBOL:

1. Domain Suitability
- COBOL is well-suited for applications in the business, financial, and government domains. Evaluate
whether your project falls within these domains or requires the specific features COBOL offers for
these areas.

2. Readability and Maintainability


- COBOL is known for its readability, with English-like syntax. Assess whether your team can easily
understand and maintain COBOL code, especially if you have legacy systems to support.

3. Legacy System Integration


- If you're working with legacy systems, COBOL may be a valuable choice for maintaining and
extending these systems. Evaluate its ability to seamlessly integrate with existing code and
technologies.

4. Performance and Scalability


- COBOL is often used for high-performance, large-scale systems. Assess whether it can meet your
performance requirements and if it's scalable to handle increased workloads.

5. Portability
- COBOL programs can be compiled and run on various platforms. Evaluate whether COBOL
supports your target platforms and consider the ease of porting code if needed.

6. Tooling and Development Environment


- Consider the availability and quality of development tools, IDEs, and debugging support for COBOL.
This can significantly impact developer productivity.

7. Community and Support


- Assess the availability of a COBOL developer community, online resources, and support services. A
strong community can help with problem-solving and knowledge sharing.

8. Security and Compliance


- COBOL is often used in industries with strict security and compliance requirements, such as finance
and healthcare. Evaluate whether COBOL can meet your security and compliance needs.

9. Cost
- Consider the cost of licensing, maintenance, and training for COBOL development. Evaluate
whether it fits within your project's budget.
10. Modernization Options
- Determine whether your project might benefit from modernization efforts, such as using COBOL
alongside more contemporary technologies or gradually transitioning away from COBOL.

11. Available Talent


- Assess the availability of COBOL programmers in your region or the feasibility of training existing
developers in COBOL if necessary.

12. Long-Term Viability


- Consider the long-term viability of COBOL for your project. Analyze whether it aligns with your
organization's strategic goals and the expected lifespan of your application.

Ultimately, the criteria for evaluating COBOL depend on the specific context of your project, including
your industry, existing systems, and project requirements. It's essential to carefully weigh these
factors to determine whether COBOL is a suitable choice for your programming needs.
Syntax/Data Structure of COBOL

COBOL (Common Business-Oriented Language) has a unique syntax and data structure that is
designed to be highly readable and suited for business applications. Here are some key aspects of
COBOL's syntax and data structure:

1. Division Structure
- COBOL programs are divided into four main divisions: Identification, Environment, Data, and
Procedure. Each division serves a specific purpose.
Identification Division-Contains program identification information.
Environment Division- Specifies input/output file descriptions.
Data Division-Declares data structures and variables.
Procedure Division-Contains the actual executable code.

2. Program Structure
- COBOL programs are structured using paragraphs and sections. A paragraph is a collection of
COBOL statements, and sections are groups of related paragraphs.
- The PERFORM statement is used to execute paragraphs or sections.

3. Statements
- COBOL uses English-like statements that are easy to read and understand.
- Statements often start with a verb, such as DISPLAY, MOVE, ADD, SUBTRACT, etc.

4. Variables and Data Types


- COBOL supports various data types, including numeric (e.g., PIC 9(5) for a 5-digit number) and
alphanumeric (e.g., PIC X(10) for a 10-character string).
- Variables are defined in the Data Division, and their data types are specified using the PIC clause.

5. Data Hierarchy
- COBOL allows you to define complex data structures, including records and arrays.
- Records are composed of fields, and fields can be elementary (simple data types) or group
(containing other fields).

6. Conditionals and Loops


- COBOL provides conditionals like IF, ELSE, and END-IF for decision-making.
- Looping is achieved using PERFORM statements with conditions, often in conjunction with THRU or
UNTIL clauses.

7. File Handling
- COBOL supports sequential and indexed file handling for reading and writing data to external files.
- File descriptions are declared in the Environment Division.

8. Paragraph Naming Conventions


- Paragraph names are often chosen to be descriptive of their purpose, making the code self-
documenting.

COBOL's syntax and data structure prioritize human readability, making it suitable for business
applications and environments where clear and well-documented code is essential.
Reference:

https://www.thepowermba.com/en/blog/cobol-the-legendary-programming-language-
that-you-have-to-know-
about#:~:text=COBOL%20was%20created%20by%20Grace,the%20first%20compiler
%20in%20history.

https://www.spiceworks.com/tech/artificial-intelligence/articles/what-is-
cobol/amp/?fbclid=IwAR0TInzpFyPw1AooFE2DxB_TMGmSj51c_WFdATcASFjdJ1trdI
HwfuT_NAg

https://www.cs.gordon.edu/courses/cs323/lectures-
2009/LanguageEvaluationCriteria.pdf

https://www.mainframestechhelp.com/tutorials/cobol/program-
structure.htm#:~:text=COBOL%20program%20structure%20consists%20of,have%20o
ne%20or%20more%20sentences.

You might also like