How I learn to code in COBOL Programming Language In just one day.

Recently the COBOL programming language makes it to the news. The Government of New Jersey cried out for COBOL programmers to help out when the COVID-19 hit on the unemployment system that was built using COBOL. COBOL is mostly a language of the mainframe computers that can handle large scale datasets. At the moment the need for more COBOL engineers needed to maintain the existing system is growing and it will, after COVID-19. Remember, the old system needs to be maintained to function properly. New engineers are needed to be trained for this.

Note: COBOL is a very powerful programming language and it's still as faster than most of the modern programming language will use today.

I have never programmed in COBOL before until today, however, I have read about the language in the course of learning the history of computer programming.

Brief History

Just like others, I enjoy and love histories and I like to know a brief history of whatever I am learning and why. COBOL was invented by Grace Murray Hopper team in 1959 and it becomes Object-oriented language in 2002. It was one of the prominent programmings highly use at that time for business applications and large dataset processing like the unemployment system in New Jersey U.S.A and even now many government applications are still running on COBOL. This simply means the old system will have to use a lot of batches of files that need to be processed at the same time and endless output in file formats.

Well!!, COBOL is not exactly as bad as it was described as a hard language to learn. It's quite very simple to program. Remember language can be only simple when there is a large community of developers and tools, libraries and books to be read.

It should be quite easy for a developer to pick a language within 2-5 days and he or she should be able to start a practical project with it.,The only problem with language learning is the syntax and structuring of coding and choosing the compiler to use and how to set it up.

Tips in learning a new language

  1. Setting up your development environment.
  2. Data Type and Variable Declarations
  3. Data Type operations
  4. Control Structure
  5. Code Organisation
  6. File Operation and Accessing computer resources
  7. UI Programming if the language supports it.
  8. Choose a real-world problem to solve and implement.


The above is how I learn to code with COBOL programming language and it only took a few hours of my time.

SETTING UP COBOL DEVELOPMENT ENVIRONMENT.

Using the Open Cobol IDE for this tutorial, since setting it up is quite simple and just a normal installation process of installing an application, I prefer to use it for the now in case there is better IDE out there that I don't know of.

No alt text provided for this image

Download & Installation

Download and install the window version and there is a lot of tutorials out there to do the same in another operating system like MAC or Linux(I don't know how to do that yet)

No alt text provided for this image

Creating your First Programming Language Using The IDE above.

  • Click on the new button as shown below.
No alt text provided for this image
No alt text provided for this image

Click on the okay button, the IDE will show an empty file and you can type this code hello world code into it and compile & run to make it runs and display the output.

No alt text provided for this image

If it does work and the out is display as shown below then yea! you are a COBOL coder and the rest is just to understand the language structure and I will show you how I learn it today.

Output result.

No alt text provided for this image

Data Type and Variable Declarations

If you understand how computer data type works, you should already know by now that these are merely memory abstractions and type restrictions enforce by the language on how to generate the data to be store on computer memory.

COBOL programming language is kind of different compare to current modern traditional languages.

In other, for me to learn the language quicker within as I claimed today, I started to think of the language as a data sheet with an organized structure which is:

  • SECTIONS
  • PARAGRAPHS
  • SENTENCES
  • STATEMENTS
  • CHARACTERS
  • DIVISIONS

If you take a close view of the Hello example above you will notice that 3-division has already be used.

which are IDENTIFICATION, DATA and PROCEDURE Division

The IDENTIFICATION division is used to identify the program id.

While-else, the data division is used to declare variables and data to be used in your program.

Finally, the PROCEDURE division is where your program logic code goes in.

How to declare a variable.

Every COBOL variable has to be declared before it can be used in the procedure division where the logic of the program is implemented.

Variable Declaration Syntax.

LEVEL-NUMBER VARIABLE-NAME PICTURE-CLAUSE VALUE[optional].

1) LEVEL NUMBER

Use to specify the level of data in a record.

01 - mean Record Description entry level:

2) VARIABLE NAME

This can be any name the user what to give to the variable.

3) PICTURE-CLAUSE

This is used to specify what data type and its size to be declared.

Syntax

PIC DataType(Size),

DATA TYPE

9 = Numeric

A = Alphabetic

X = Alphanumeric

Y = implicit Decimal

....


VALUE

This is a keyword used to initiate the data during a declaration.

Therefore to declare a variable that will hold an age of users you can do this in the data division and use it in the procedure section.

No alt text provided for this image

I bet you can tell the output of this program, you don't have to learn all the command of a language to solve a problem.

The article is getting bigger and I am going to stop here to start a new article on Data Type Operations and how I learn to code in COBOL during covid-19 lockdown within a day.

Regards





















To view or add a comment, sign in

More articles by Obaro Israel J.

  • AI Is Not Taking My Job — It Hasn’t Even Met My Imagination Yet

    The idea that AI is going to take my job is everywhere. It’s loud, unsettling, and often repeated by people who haven’t…

  • Training a Basic Single-Neuron Perceptron (SNP)

    The common saying goes that if you can learn to ride a bicycle, you can eventually ride a bike and then drive a car…

  • 2025: The Year of Data

    The future is for those who truly grasp how to work with data. For those who believe studying mathematics in 2025 is a…

    1 Comment
  • The Key to Scalability: Understanding Micro-service Architecture

    Are you tired of dealing with slow, cumbersome software that's hard to update and maintain? Microservice architecture…

  • What is Crypto-Currency?

    The year 2020 was one of the most frustrating to many people and one of the happiest to others. The sudden "***BOOM****…

  • Understanding Computer Language

    If you want to be able to speak with an Hausa person you will have to learn how to speak the Hausa language, if you…

    1 Comment
  • The Lock Down

    The lock down, this is the time where the earth is taking a break from the busy world. A time where the citizen…

  • To explain and to have the knowledge, is different.

    Explanation is hard, and its a constant learning process, I will definitely say yes to that, I an not good at…

  • The Obstacles Of Progression

    In 2020, the world will change, that is what I was told and read about, yet it's still the same, people do things the…

    2 Comments
  • Part to Understanding Operating Process & Multiprocessing

    The most central concept of an operating system is the process and how its managed. A process is a software abstraction…

Explore content categories