What is COBOL and Who Still Uses It?
What is COBOL and Who Still Uses It?
| technology | programming - Erik Mikac

What is COBOL and Who Still Uses It?

Right now, it’s common to hear governors on national television asking for more resources to help them combat the COVID-19 pandemic. Often enough that means asking for healthcare professionals  and medical supplies, but in at least one case the ask was for COBOL developers. That may seem strange to the uninitiated, but anyone who has worked with a COBOL system understands.

COBOL is a language that’s notoriously difficult to learn, maintain, and upgrade. Yet, is still widely used in insurance, finance, and the public sector. More than 95% of ATM swipes and 43% of banking systems are written in COBOL . Moreover, nearly a quarter of states make unemployment transactions on systems that use the Cold War-era programming language.

It’s mind-boggling, but COBOL is still critical to institutional systems due to a “if it ain’t broke, don’t fix it” mentality. Let’s take a look at what COBOL actually is, who uses it, and how more advanced technology can be adopted.

What is COBOL?

COBOL, or Common Business-Oriented Language, is a procedural programming language created in 1959 focused on readability, self-documentation, and ease of use. Procedural programming means a programmer tells the computer what to do step by step. Object-oriented programming, on the other hand, is where the developer designs classes to represent the data getting passed to and from the computer.

One of the easiest ways to understand COBOL — or any programming language for that matter — is to see a snippet of its code. It’s perfectly O.K. if you understand very little of it. The purpose of this showcase is to go over COBOL’s trademark readability.

This code snippet is an example of COBOL, and consequently procedural programming. Notice that there are no defined objects. This script is simply telling the computer what to do from line 1 all the way down to line 30, where we end the program. Notice also that on lines 6 through 8, COBOL needs to know the type of data being used and how many digits it will be. In other words, this is how we would like COBOL to “picture” the data, thus the PICTURE keyword.

In this code, the easiest part to understand will likely be the middle part — the portion that begins with MAIN-PROCEDURE. For example, on line 13 we are instantiating FIRST-NUMBER with the number 8. In new and less verbose languages, this would be done by declaring FIRST-NUMBER = 8. However, as specified in its name, COBOL was meant for business-oriented folks, not mathematicians. So, the idea was to make it as readable as possible.

Let’s take a look at the same program, except written in Python:

 

Notice that this program only takes 10 lines to write, while the COBOL program takes 25 to write. COBOL sacrifices verbosity for readability, while Python sacrifices readability for brevity. (Though if the code is written well, that shouldn’t necessarily matter.) The Python program could easily be written in one line, and for as many variables as we choose.

So why is an article about COBOL bringing up Python? Because nearly every programmer will understand this Python code, but the COBOL code not so much. And therein lies the problem that companies today are facing.

The average age of a COBOL developer is 55, and they are quickly leaving the workforce. This leaves very few professionals to maintain these legacy systems — and professionals who could learn it avoid it like the plague. One of the reasons is that COBOL is not particularly easy to write. Every one of the lines written above are mandatory. In other words, the program will crash even if the period on the last line is missing.

Who Uses COBOL and Why?

Any company using COBOL in 2020 is doing so because they must. The companies come from a wide range of industries. Most notably, insurance agencies, banking industries, and the government sector. Small companies in this day and age can rewrite their code into a more modern programming language fairly easily. However, huge companies or bureaucracies will have many millions of lines of COBOL code to grapple with— to rewrite this critical business logic would be a nigh insurmountable initiative.

What’s worse, these many millions of COBOL code are more than likely completely undocumented. So, not only is there no documentation, but the folks who wrote it probably left the company 10 or 20 years ago. This leaves these companies in quite a bind, because as COVID-19 taught us, this COBOL code is not particularly scalable, and there are few professionals to maintain the code for scalability or oversee a transfer.

Here is a quick scenario to illustrate the hurdle these companies are attempting to overcome. Let’s say that you are a Python programmer. You have been charged with rewriting 20,000 lines of COBOL code into Python so that code can become cloud scalable. These 20,000 lines of code are for a major bank, so you will be rewriting transactions, bank records, and interest calculations. In other words, any code that is written incorrectly could cause millions of dollars in damage in a highly regulated industry. Also, you will be re-writing this code without any real knowledge of what the existing code actually does.

Would you want that job? Probably not, and very few do. After all, modern languages like Python and COBOL are very different beasts as shown above. This is the unfortunate COBOL quagmire that companies and federal agencies have found themselves in. COBOL code is unlikely to be removed anytime soon because there are not enough professionals with the technical know-how to do so, lack of technical documentation, and the business logic is too critical for any rewrites.

There are many hurdles to leap over with regards to a COBOL rewrite. The best way to perform this Herculean task is very slowly and incrementally. The only other option is to accept COBOL and begin rigorously training new computer science graduates in the art of procedural programming. It will be up to the company making the decision as to whether the latter or former decisions are more desirable.

Final Thoughts about COBOL

There are ways to slowly disengage with this outdated programming language. COBOL, in and of itself, once revolutionized the business industry, and is by no means a “bad programming language.” The issue lies in its scalability, maintainability, and upgradability.

  • Scalability: Unless we deploy COBOL to the cloud, there is no way to scale it.
  • Maintainability: Unless we pull COBOL developers out of retirement or train unenthusiastic newbies in its art, there will be no way to maintain it.
  • Upgradability: Unless we study and document tens of millions of lines of source code, there will be no way to upgrade it.

Hopefully this article has illustrated how a cold-war era programming language has become vital to national security. By now you may have a better understanding of what COBOL is, why it is still used, and the challenges it faces in the future.

Download

Download

Ultimate Systems Administration Cert Guide

A 158-page guide to every Microsoft, VMware, Citrix, AWS, Google, and Linux certification, and how they fit into your career.

I have read and understood the privacy policy, and am able to consent to it.

CBT Nuggets uses cookies to give you the best experience on our website. You can read more about our use of cookies, or just continue to use the site as you normally would if you agree.