Volg ICTI

Is COBOL futureproof? COBOL in 2024

| Sieuwert van Otterloo | Software

COBOL is the miracle dinosaur of computer programming languages: It is very old and it should have been replaced by other languages, but somehow it still survives. This causes problems for companies, since many COBOL programmers are retired or will retire in the next decades, leaving companies without anyone to maintain some of the most critical programs. In this article we explain the COBOL situation and some of the research done on COBOL in 2023 and 2024.

Why languages popularity is important

Organisations are often very dependent on their IT systems, and it is therefore important that the IT systems are reliable, trustworthy and future proof. Choosing a suitable programming language is an important factor in the trustworthiness and future-proofness of IT systems. If a certain programming language is no longer supported or if no experts for a language are available, the IT system cannot be maintained and must be replaced. ICT Institute and other research firms, such as SPR or SIG are therefore tracking the use and health of programming languages. See for instance our technology risk assessment research.  COBOL is a language that was very popular and future proof in the 1970’s and 1980, but that has become a liability due to lack of developers. The demise of COBOL has therefor been predicted for decades (since the mid 1990’s), but somehow the language is still in use. Understanding the continued existence of COBOL is important in order to understand the current COBOL risks, but also to understand how other languages will develop.

COBOL origins

COBOL stands for COmmon Business Oriented Language. The language was created around 1959, in order to make a computer programming language that was suitable for business applications, that was portable and understandable by many people. Portable means that programs written on one computer also work on other computers. Many computer programs around 1959 were written in machine code or assembler, and had to be rewritten for each computer. Some other portable languages existed (Fortran and Algol) but these were more science-oriented using many mathematical symbols. To make COBOL understandable, COBOL uses many English words. The creation of COBOL is sometimes credited to Grace Hopper, who designed the language FLOW-MATIC that was a large source of inspiration for COBOL. Grace Hopper is included in the ICT Institute list of influential computer scientists.

COBOL code can be recognized by the use of full English words, rather that brackets and special symbols. The example program below reads a line of input and replaces characters according to ROT13 encryption. The program is part of a collection of programs in all different languages that do Rot13. It is a good resource for language comparison. Note that the use of DIVISIONs is also a COBOL trademark. It is intended to improve program readability.

COBOL strengths

Mainframe computer manufactures all decided to support COBOL development, and as a result COBOL became the language of choice for business programs on mainframe computers. Mainframe computers became very popular in the 1960’s and 1970’s: mainframes are very well suited for large companies where performance is important and cost is not an issue. The dominant mainframe company was IBM. So dominant in fact that the company was under investigation for years by the US government for unfair business practices. Mainframes were for instance used in banks for payments processing. Replacing payments processing systems was proven to be so hard that banks are still using the same COBOL programs for payments.

COBOL beyond Mainframes (added aug 2024)

For many people, mainframes and Cobol are intertwined: they only know COBOL as the language for creating software for mainframes, and often conflate mainframe issues and COBOL issues. As some people pointed out on the GnuCOBOL forum, there is an open source implementation of COBOL (GnuCOBOL). This allows people to run COBOL on PCs and thus makes COBOL much more accessible to many people and also companies. So in a purely technical sense, COBOL is not dependent on mainframes and if you want to start using COBOL, GnuCOBOL is a good starting point. However, many companies have started using COBOL on mainframes. Their COBOL development tools and programs are dependent on mainframe technology and this can cause issues.

Problems not caused by COBOL itself

Many programs written in the 1970’s only use two digits for recording years, using “23” to denote the year 1923. This obviously led to problems as the year 2000 was approaching and was called the millennium bug. A huge effort was made just before the year 2000 to upgrade most programs, and in many cases replace older programs (in COBOL) with better programs in newer languages such as Java. The millennium problem is not unique to COBOL. It just so happened that COBOL was one of the best programming languages from the 1970’s, so many programs from that era are written in COBOL.

COBOL as a language itself is not remarkable. It works. Some programs written in COBOL are very long and verbose, but this is a matter of style since one can also write more readable programs in COBOL. There are for instance COBOL two versions that do the common reference task of printing “99 bottles of beer”. The first COBOL version is quite readable and not much longer than the same program in modern languages. Another user has provide a much longer version in a typical mainframe style.

COBOL does support some questionable programming constructs. It has a GOTO statement, and GOTO is considered harmful by famous professor Edsger Dijkstra.Please note however that Edsger Dijkstra had no experience at all in business computer programming and is therefore not an expert. Professor Howard Tomkins is an expert and wrote an interesting defense of COBOL. In this article it is explained why some academics do not understand and therefore unjustly dislike COBOL.

COBOL also has an ALTER statement that even according to IBM encourages unstructured programming. It is however easy to avoid these keywords if one wants to avoid these issues.

COBOL weaknesses

One problem with COBOL is that it is niche language with only limited libraries. It is suitable for business data processing but not for other programming domains. COBOL has not evolved to support graphical user interfaces, multimedia processing, game development or machine learning.The most advanced ‘graphics’ supported in COBOL are based on multicolored text in a fixed ‘terminal style’ font, as shown below (source: GnuCOBOL examples). So for certain applications where you need certain libraries and need to design systems with built in user interfaces, COBOL is not the most logical choice. This argument however mostly applies to small teams and companies: If you are a larger company with multiple teams, you can create separate front end and backend components in different technologies.

The lack of modern functions makes the language less suitable for some types of systems. Many people therefor are less interested in learning COBOL, and many companies are also less interested in using COBOL as it does not suit their needs.

The second problem with COBOL is that the COBOL variants companies used are often designed for mainframe computers, and mainframe computers are ridiculously expensive. Mainframe computers are so expensive that the actual price is hard to find (“if you have to ask the price, you cannot afford it”) but allegedly each mainframe computer costs millions and does not fit in a normal room. Needless to say, mainframes are rare. Many people, including students, academics, small businesses and individuals only have access to personal computers and not to mainframes. To make software and computing accessible, it is important to not develop in COBOL but to chose accessible languages. IBM and other mainframe manufacturers could have done more to make COBOL accessible to everyone, for instance by creating good open source operating systems and compilers.

Thirdly, many companies do not want to develop new systems in COBOL, due to it being a niche language and its expensive hardware requirements. So if you learn COBOL, you will maintain existing software but not work on new systems. The fact that COBOL is not seen as a modern language is evident from the fact that many papers define “modernization” as getting rid of COBOL. See for instance Knoche, “Using Microservices for Legacy Software Modernization” from 2018, where a modernization project is defined with three goals, the third being “an incremental platform migra­tion from Cobol to Java“. This goal of phasing out COBOL has made some developers reluctant to base their career on COBO. Fortunately for many developers, modernisation efforts often do not succeed and the phase out of COBOL is often not realised.

COBOL in 2024

Ashish Upadhaya completed his master thesis “Understanding Legacy Software: The Current Relevance of COBOL” in 2023 at VU University. He works as a COBOL developer at an unnamed bank in The Netherlands, with offices in Amsterdam and Rotterdam. In his thesis he investigated the relevance of COBOL in 2023 in multiple ways. His research is related to other research at ICT Institute, including research into python and language ecosystems.

He interviewed IT experts at a bank about the current use of COBOL. The main result is that the bank is replacing COBOL by more modern technology, but very gradually and slowly. The number of COBOL programs has been reduced from 57000 programs to a more manageable 27000 programs. Maintaining and updating COBOL systems is described as highly challenging. COBOL is expected to continue to be used since it is an integral part of the bank.

He also investigatde what resources are available for people interested in learning COBOL. It turns out that there are sufficient learning resources, such as a YouTube videos by Derek Banas, that comes with a nice COBOL cheat sheet, or this very long COBOL video  from TopicTrick.  that is accompanied by a Udemy COBOL course.  Other resources include the enthusiast website https://ibmmainframes.com/programs.php.

Ashish also searched for example programs, since examples are important when learning or teaching a languages. He was able to find around 40 programs, most less than 100 lines of code. This is better than nothing but does show that actual COBOL code are real applications are hard to come by. Most programs are small demonstrations for educational purposes, not usable applications.

Since Ashish is one of the few people in The Netherlands with access to a mainframe, he was also able to test the compatibility of the open source GnuCOBOL compiler against an ‘official’ IBM mainframe compiler. Of the 40 (small) programs, 39 ran successfully both on the real mainframe and on a personal computer using the GnuCompiler. This is enough for people to use GnuCOBOL to learn COBOL. One program required an additional technology ‘Job Control Language’ (JCL) that made it harder to run on a personal computer.

Conclusion

COBOL is an interesting niche language for people who are interested in banks, payments and transaction processing. COBOL however is not seen as a modern general purpose programming language: Companies want to modernise by replacing COBOL and are not considering COBOL for new systems. The reason for its unpopularity for new development lies not in the language features itself, but by its association with mainframes and focus on business transactions. Most people have broader interests and do not have access to mainframes, and most companies are not interested in introducing mainframe-related technology in their landscape. It is possible for people to learn COBOL using available resources and it can be a good way to get a stable career.

Image credit: joshua-cotten-unsplash. It shows a Komodo dragon, a still living animal sometimes compared to extinct dinosaurs

 

Author: Sieuwert van Otterloo
Dr. Sieuwert van Otterloo is a court-certified IT expert with interests in agile, security, software research and IT-contracts.