The mainframe world
When you pay by card, file an insurance claim or get paid, there is a good chance a COBOL program touched the money. Most large banks, insurers, airlines and government agencies run their core systems on an IBM Z mainframe, and much of the business logic on those machines is COBOL written over the last fifty years and still maintained today.
What a mainframe is
A mainframe is a single, very large, very reliable computer built for huge volumes of transactions and data. The operating system you will meet on the job is z/OS. Around it sit the products you will hear about constantly:
| Name | What it does |
|---|---|
| JCL | Job Control Language: describes a batch job, its steps and its files |
| CICS | Runs online transactions (screens, API calls) |
| Db2 | IBM's relational database on z/OS |
| VSAM | Indexed and keyed file storage |
| TSO/ISPF | The green-screen editor and shell where you work |
Files on z/OS are called datasets and have dotted names such as
PAYROLL.EMPLOYEE.MASTER. You will use names like that throughout this
course.
Batch and online
COBOL work splits into two worlds:
- Batch: a program runs unattended over thousands or millions of records, usually overnight. Interest calculation, statement printing, payroll and end-of-day reconciliation are batch. A scheduler submits the JCL; the program reads input datasets and writes output datasets and reports.
- Online: a CICS program handles one request at a time while someone waits, like a balance enquiry at an ATM.
This course starts with batch because it is where most new mainframe developers begin, and where the core language skills are the same.
A tiny batch-style program looks like this. It writes to the job's output, which on z/OS lands in a spool file you read with a tool such as SDSF:
IDENTIFICATION DIVISION.
PROGRAM-ID. NIGHTLY.
PROCEDURE DIVISION.
DISPLAY "NIGHTLY INTEREST RUN STARTED".
DISPLAY "NIGHTLY INTEREST RUN ENDED".
STOP RUN.
Why COBOL is still everywhere
- It works. These systems encode decades of tested business rules. Rewriting them risks getting a rule subtly wrong with real money.
- Decimal arithmetic. COBOL does exact decimal maths.
0.10 + 0.20is exactly0.30, which matters when you add up a billion transactions. - Throughput. Mainframe batch processes enormous files quickly and reliably, with almost no unplanned downtime.
- People are retiring. Many of the developers who wrote these systems have left, so employers need new people who can read and change them.
On the job
Your first mainframe tasks are rarely new programs. Expect to read an existing program, change one business rule, recompile, run the batch job in a test region and compare the output with the old version. Reading code carefully is the core skill this course builds.
In this course you write and run programs with GnuCOBOL, a free compiler that accepts the same language as IBM Enterprise COBOL for everything we cover. Where the two behave differently, the lesson tells you.