Cobol programming language, AS/400, RPG. Cobol continues to ensure the successful completion of business transactions.
COBOL, AS/400, mainframe, RPG – Just a bunch of words that mean nothing to a young IT expert. But they are here, all around us. They do their job, they are just not as highlighted, not as sexy as a mobile app.
A Little History
The year is 1959. Fidel Castro brings the revolution to glory in Cuba. In Hungary, Péter Mansfeld is executed for taking part in the Hungarian Revolution of ’56. Disney’s Sleeping Beauty and Ben Hur hit the theatres, and in Hungary, the first episode of Szabó Család airs. The iconic Mini appears on the roads, and Barbie dolls become available in stores. The satellite Luna 3 makes the first pictures of the dark side of the moon. In this year were born: John McEnroe, Sean Bean, Magic Johnson, and Emma Thompson. Feel old yet? Moreover, it was in 1959 that the baselines of Common Business Oriented Language, presented to the world as COBOL programming language, were laid down. (The first official version was published in 1960).
You can rightly ask: why are we writing about this in 2023, when this programming language is over 60 years old? Only because COBOL and the solutions built on it are the big survivors of IT. In an industry where 5-10-year-old solutions are ancient history, COBOL, with the stubbornness of a crocodile or a shark, just won’t go extinct.
Don’t think that you can find programs written in COBOL only in the hidden corners of company data centers, concealed from everyone. According to data compiled by Reuters, COBOL applications process 95% of ATM transactions, 96% of travel reservations, and 80% of POS transactions. There are 60 million lines of COBOL code in the Social Security Administration’s technology infrastructure and 50 million in that of the Internal Revenue Service.
In total, a COBOL code is concerned with 70% of business transactions. If these stopped abruptly, life would stop with them. In a sense, it did stop in April 2020: the governor of New Jersey wasn’t only looking for voluntary medical workers, but COBOL programmers as well. What happened was that the State's 40-year-old system for processing unemployment benefits applications simply couldn't keep up with the sudden load increase.
There is an interesting duality in COBOL’s world today. At the beginning of 2023, it is only in the 31th position of the Tiobe index ranking of programming languages; even Fortran outranks it. (If you don’t want to click on the link, the first three on the list are C, Java, and Python). According to a study, in 2013 70% of universities didn’t teach COBOL, and the average age of COBOL programmers is 55 years.
However, even today, around 220 billion lines of code run on COBOL a year. Besides, as we mentioned above, this programming language has a key role. This means that in the upcoming years, younger developers will be needed who are not only able to do maintenance on this software but who can migrate them as well onto newer systems.
Finding Cobol developers is an extremely difficult task these days, but we can help.
If you require a Cobol programmer, please do not hesitate to contact us!
Request for offer
The Birth of COBOL
COBOL was born in 1959. Every computer manufacturer (there were around half a dozen in the USA) delivered their computers with their own operating system and their own programming language. This meant that the programs were practically bound to a given computer model or supplier. Following an initiative (and financial support) from the American Department of Defense, a committee designed COBOL that quickly became widespread. IBM quickly embraced the language.
One of the big innovations of the new programming language was syntax. The commands were heavily based on the English language, as opposed to the codes of other languages (especially FORTRAN) which resembled mathematical formulas.
COBOL instructions are written in a sentence-like format, with a verb and a subject, similar to English. This makes the code easy to read and understand. The point was to let other developers and non-IT experts understand programs written in COBOL. A COBOL code almost “tells the story” of what it does (almost like BASIC). The result was a particularly "talkative" language that most programmers today find strange.
Syntax obeys very strict rules, going far enough to even determine the number of spaces before a command. This comes from the punched cards used to enter a program: Their precise elaboration was crucial.
What is the structure of a COBOL program?
A COBOL program should consist of four main parts, in order: the Identification, the Environment, the Data and the Procedure Divisions. (In COBOL, uppercase letters are used to distinguish the division names from the rest of the code. This makes it easier to identify the different parts of the program.)
- The identification part is a kind of meta-description of the program, and it contains basic information like the name of the program, the author, and the date of creation.
- The environment part describes the work environment. (This changes if the software is running on different hardware.)
- The data part contains the files and variables.
- The procedure part contains the actual program code.
Why Does COBOL Still Exist?
COBOL might have many shortcomings. But what COBOL does, it does it very well. That’s what helped it to survive. According to an article by Robert L. Glass from 1997, COBOL has four characteristics that make it more fitting for the efficient execution of business tasks than most languages today:
What makes COBOL such a survivor? The answer is simple—the programs written in COBOL work, and they work well. And be sure of this: IT professionals are averse to modify codes that work accurately. In addition, the programs do not only perform very well the task for which the professionals developed them. They are huge software systems: replacing, changing, or restarting them is so big of a challenge that no company wants to get into it. If it works, don’t touch it!
AS/400, IBM Mainframe, And RPG
The sturdiness of COBOL and programs written in COBOL made some computer architectures survive the revolutionary changes so typical in IT. The two most obvious examples are mainframe and AS/400; both platforms are from the company that gave birth to COBOL: IBM.
It was in 1964 that IBM released its first real mainframe system, the System/360. It combined the capabilities of the hitherto separately sold models of scientific and general-use computers: for instance, decimal and floating-point arithmetic. A hardware memory protection unit separated the operating system from the running programs and the programs from one another. This way if an error occurred in one of them, it wouldn’t affect the others.
After going through many development phases, IBM named the system the Z series, and besides the traditional z/OS and z/VM and others, it is now available in Linux. And take a look at that! The largest Oracle database and SAP system in the world run on a Linux mainframe.
And why? Because in some cases it is a better idea to buy one very expensive mainframe than to buy a bunch of cheap x86 servers. One large machine can do the work of dozens of multiprocessor x86 servers, takes up a lot less space, and has significantly lower electricity and cooling needs.
The point of a mainframe architecture is that it uses different processors for different tasks. On a regular PC server, the CPU performs all tasks, starting from the operating system, through the application to hardware management. In a mainframe, when the processor running the application sees that the program needs an I/O process or floating-point arithmetic, it sends the task to the appropriate processor. A single mainframe can be comprised of up to hundreds of processors, each of which is used for different purposes.
The hardware wears the signs of the time when engineers designed computers for engineers. Its build is robust and redundant; the motherboard can be pulled out of a mainframe and it will keep working as if nothing happened. A hard drive failure doesn’t affect it one bit. Reportedly, during a strong earthquake, all the x86s broke down in a Japanese data center, but the only mainframe they had just flipped over on its side and kept working.
The other representative of old-school IT is the AS/400 presented in 1998. AS is short for Application System; today, after IBM renamed it a number of times, it appears in IBM’s catalog as “System i”. One of its many particularities is that it was the first to have an object-oriented operating system (OS/400). In the computer, links are exclusively based on the object's name and type. The machine’s internal processes do the addressing, the programmer or the user is not required to do anything.
Another particularity of the AS/400 is the integrated DB2 database manager. The record-oriented functioning of DB2 demonstrates its central role. Here the system doesn’t deal with every keyboard stroke. It waits until the user fills out the whole record and presses enter, and then it processes it all together. This meant it could complete certain (and mainly) transaction tasks using up a lot fewer resources than the other company-oriented IBM system of the time, the RS/6000 running Unix. No wonder it became so popular in the financial sector that it was often referred to as an “accounting machine”.
Similarly to mainframes, the hardware of the AS/400 is hierarchical in design. Besides the main processor doing the actual calculations, there are many other processors doing auxiliary tasks such as peripheral management. With a technology called strifing, it is possible to improve the system's performance by adding additional hard drives.
Another particularity of AS/400 is its single-level storage. Data storage and memory are addressed individually, and the operating system decides which elements of the database go on the hard drive, and which ones go to the memory.
This can be both a strength and a weakness at the same time. It is a strength because the size of the memory doesn’t limit the running program. It is a weakness because in case the computer suddenly powers down, the system becomes inconsistent. To avoid this, they installed batteries around the memory.
Security is a Strength of AS/400
An important element that makes the AS/400 popular even today is security. If one tries to modify an object using anything else than the standard procedure, the hardware bit inside “falls”. This means that it is not possible to use the object as a pointer anymore, but only as data. Thanks to this, hackers cannot launch a buffer overflow attack against it. The main admin password is basically the only way to access an AS/400.
Stability of Value
IBM made considerable efforts to make their programs maintain their value. The virtual command suite called TIMI (Technology Independent Machine Interface), and the translation program translating the source code in two steps both serve this purpose.
The first, temporary code is the pseudo-code that AS/400 will keep in the final program. If later the machine perceives a change in architecture or addressing, it re-runs the module on the first execution of the program. Thanks to that, a code written a long time ago can still run on newer systems. There is no need to retranslate the program, let alone touch the source code. No wonder software written decades ago still runs in many places.
The fact that shows their foresight is that all pointers are 128-bit according to the command suite, whereas the original ones used 48bit processors and addressing space; today, they use 64bit PowerPC processors. If a 128bit processor appears for general use in the future, Series I will be ready for it.
Development of AS/400
In the past years, the AS/400’s software and hardware both saw notable advancements. Its operating system can be its own IBM i, as well as AIX, Linux. On internal blade servers it can even run Windows 2000 and Windows Server 2003. IBM i, Linux, and AIX can even run simultaneously on a computer, along with the logical partitioning called LPAR.
Basically, every piece of software needed for running and managing the system, from the database manager to the webserver is integrated into the operating system. So, while its price is quite high, you will not have to consider expenses that typically come up with other servers. While it was originally designed for terminal access, it supports client-server functions, its database is accessible in programs written in Java, .NET or other languages.
Continuous development allowed programs written decades ago to be functional on the platform even today. The banking sector had a preference for the AS/400, because at the time of the development of banking software—in the first half of the 1990s—this was the most reliable, the safest, and the most performant computer (not counting the much more expensive mainframes, of course). Some Hungarian banks still run their account management systems on it. Other companies manage their accounts on different systems, but they still process their card transactions on AS/400.
It is also popular among retailer networks—there are chains that process all the data of all their units on one single iSeries computer. In other cases, it is used specifically as a database server because the other systems cannot compete with it in terms of speed.
In the past, there were hundreds of AS/400 in use. Their number is not necessarily decreasing because applications are migrated to other platforms. The hardware became stronger and allowed consolidation. There used to be dozens of machines to meet the demand, whereas today a single central system can do the job, even from abroad.
RPG – The Unknown Little Brother
If COBOL has become an obscure programming language today, what should we say about RPG, which isn’t even in the first 50 on the aforementioned Tiobe index ranking? RPG (Report Program Generator) is a programming language developed by IBM. Interestingly, it was born in 1959, just like COBOL.
It was first used for mainframe programming, but later it became a high-level equivalent of COBOL and PL/I, and it became AS/400’s own “personal” programming language. (The OS/400 itself was written with RPG at the beginning, but it was later readapted using C++). It was originally designed to replace punched cards. As a result, it remains a fixed notation language—in other words, there are strict limitations on what and where we can write (lines, columns).
For the AS/400, the RPG III was used at first. But the real native programming language for the AS/400 became the RPG IV, which was integrated into the operating system. The RPG IV came out with many new features: longer field names, source-code level troubleshooting, new types of data (floating point, Boolean, pointers), integrated features, and ILE-compatibility.
Every element of the AS/400 was designed to serve business applications as efficiently as possible, and the RPG was no exception. As its name suggests, it was not intended for general use. It is specifically used to accomplish data management tasks as efficiently and safely as possible. However, complete bank-transaction software had also been written in RPG.