COBOL Tutorials | COBOL Course.
COBOL - COmmon Business Oriented Language.

COBOL Tutorials | COBOL Course.

COBOL - COMMON BUSINESS ORIENTED LANGUAGE.

Table of Content.

  1. COBOL Introduction.
  2. COBOL Program Structure.
  3. COBOL Data Types.
  4. COBOL Control Statements.
  5. COBOL String Handling.
  6. COBOL Sort Statement.
  7. COBOL Merge Statement.
  8. COBOL Compilation Process.
  9. COBOL Continue VS Next Sentence.


Introduction.

COBOL abbreviation is used for COmmon Business-Oriented Language. COBOL is a high-level language with English-like syntax.

COBOL is a language with a 60-year history. COBOL is more than just another programming language. It's an integral component in the public and private infrastructures in nearly every country on the planet. COBOL has been dominating the Enterprise Computing and it is a hidden asset.

History of COBOL.

During the 1950s, the western parts of the world experienced a tremendous need for a high-level programming language suitable for business data processing. To meet this demand the U.S. Dept of Defence convened a conference on the 28th and 29th of May, 1958 to highlight and stress the importance of a high-level business data processing language.

The conference led to the formation of a team called CODASYL (Conference On Data Systems Language). This team had representatives from civil and governmental organizations, academics, computer manufacturers, and other software enthusiasts to work towards the goal.

As a result, a new language called COBOL (COmmon Business Oriented Language) was developed in September 1959. This was released with some minor modifications in April 1960. On May 5, 1961, COBOL-61 was published with some more revisions. It is this version that provided the foundation for later versions.

In 1965, a re-revised version of COBOL was released with a number of additional features. However, it was only in 1968 that COBOL was approved by ANSI (American National Standards Institute) as a standard language for commercial use. This version of COBOL is known as COBOL-68. The next revised official standard was released in 1974 and is known as COBOL-74. Again, in 1985, a new ANSI version of the language called the COBOL-85 was released incorporating a number of additional features. Today most COBOL compilers adhere to the 1985 standard. The latest release of COBOL is Object-Oriented COBOL and is known as OO COBOL or COBOL 9x.

Future of COBOL.

To help one to deal with the problems of system integration, IBM has developed a master strategy for making COBOL, CICS, and DB2 the foundation for the Web and Intranet applications. In this scenario, CICS is the transaction-processing monitor for web applications, DB2 is the database and COBOL provides the business logic that drives these applications. That takes care of all the programming except for the user interfaces on the clients or the terminals and these can be developed with Java, Visual Basic, or other programming languages.

This means that all that Java and Visual Basic will do is provide the graphical user interfaces that send data to and receive data from CICS. In other words, the role of these languages will be extremely limited.

It is easy to understand that this state will prevail for quite some time at least for three reasons. First, it's a lot simpler to develop a large application with a single database server than it is to replicate that data over several smaller servers. Second, a heavy-duty transaction-processing monitor like CICS currently provides processing efficiencies that are superior to those that are possible with client/server technologies. Third, IBM is in the best position to provide workable solutions for system integration because they control the mainframes. Hence even if this master plan changes somewhat during the next few years, DB2 and CICS on a mainframe with COBOL as the self-documenting business language are going to be a tough combination to challenge and beat. Thus COBOL is by far the most dominant language on mainframes and it will continue to be so in the foreseeable future.

In fact, around 15 years back many computer experts thought that COBOL is on the verge of becoming extinct, even today some people believe the same and in my opinion, so will some people in the future.

COBOL Program Structure.

The most basic and indivisible unit of the COBOL language is the character. The COBOL character set includes 78 characters that can be classified as letters of the alphabet, digits, and special characters.

The individual characters are combined to form character-strings. A character string is a sequence of contiguous characters that form a COBOL word which may be of the following three types

  • Reserved word.
  • User-defined word.
  • Literal or Constant.

COBOL Data Types.

There are five basic data types in COBOL. They are

  • Alphabetic (Made up of only upper and lower case letters).
  • Numeric (Made up of the digits 0, 1, 2, . . . ,9).
  • Alphanumeric data (Made of both letters and digits),
  • Edited Numeric (Made up of digits and special characters) and
  • Edited Alphanumeric (Made up of letters, digits, and special characters).


COBOL Control Statements.


COBOL Evaluate Statements.

COBOL Perform Statement


COBOL String Handling.

String manipulation is an integral part of any programming language i.e. Python, COBOL, C, etc. In COBOL, UNSTRING Statements, STRING Statement, and INSPECT statement is used for various operations. Let's look at each statement one by one.


COBOL UnString Statement.

The UNSTRING verb may be used to convert the input data to a more compact form for storing on the DASD. For example, a program may include a statement that causes the following to be displayed on a terminal.

ENTER NAME: LAST, FIRST, MIDDLE INITIAL

Since each name has a variable number of characters, there is no way of knowing how large each individual last name and first name are. With the UNSTRING statement, we can instruct the computer to separate the NAME into its components and store them without the commas.


COBOL INSPECT statement.

COBOL Inspect Statement or Inspect Statement in COBOL is generally used for string manipulation operations. It's used for counting and replacing a character in the string. COBOL Inspect function has four different variants i.e. Basic Inspect in COBOL, COBOL INSPECT Tallying, COBOL INSPECT Replacing and COBOL INSPECT Converting clauses.


COPY in COBOL or COBOL COPY Statement. 

COBOL COPY statement is used to include prewritten code ( i.e. copybook) into a COBOL program during the compilation process. Thus, unlike all other COBOL statements, which gets executed during runtime, the COBOL COPY statement gets executed during the compile time. 

A COPY statement (i.e. copybook in COBOL) can be placed anywhere in the COBOL source program, but it cannot be nested. If you don't specify the copy lib then by default COBOL copybook would be pickup from JCL SYSLIB.



COBOL Compilation Process.


?Subscribe to Topictrick & Don't forget to press THE BELL ICON to never miss any updates. Also, Please visit below mention the link to stay connected with Topictrick on -

? Official Website : https://topictrick.com

? Youtube : https://youtube.com/c/Topictrick

? Follow us on Twitter : https://twitter.com/topictrick

? Facebook : https://www.facebook.com/topictrick/

? Linkedin : https://www.dhirubhai.net/showcase/topictrick

? Reddit : https://www.reddit.com/r/topictrick/

? Mainframe Blog : https://mainframe-forum.blogspot.com

Thank you for your support.

Topictrick?

#COBOL @COBOL #IBM

Mainframe Forum

Mainframe Forum: A comprehensive repository for programming tutorials and technology news.

4 年

Hi All, Thank you so much for your feedback. If you like these videos then please share them with your friends and consider subscribing to our channel for more such videos.? Thanks.

回复

要查看或添加评论,请登录

Mainframe Forum的更多文章

社区洞察

其他会员也浏览了