2003–2004

COBOL on a mainframe: ADD A TO B GIVING C, files that don't exist and half a minute to compile

Along with mainframe assembler, the university also brought in a COBOL course, for the same reason: Exigen, a company in Riga, needed people to take over from its programmers who were retiring.

First, the language itself is awful. To add two numbers you write something like ADD A TO B GIVING C. Data is described like this:

01 TRANS-REC.
   05 TRANS-KODS  PIC X.
      88 UPD-IERAKSTU  VALUE "1".
      88 INS-IERAKSTU  VALUE "2".
      88 DEL-IERAKSTU  VALUE "3".
   05 VARDS       PIC X(10).
   05 UZVARDS     PIC X(10).
   05 PERS-KODS   PIC 9(12).

Second, it has no stack. We only realised it later: if you call another procedure, everything it needs (local variables, state, where you were called from) you have to set up yourself in advance, essentially in global variables. So recursion is impossible. We asked: “All right, but can function A call B, and then B call A?” The teacher scratched his head: “No, that won’t work either.”

The classes were in a computer room, and they were taught by people from Exigen. They didn’t really know how to teach and couldn’t explain anything. We sat there with no idea what to press. “Here’s the terminal, log in, run it.” I thought a terminal meant something like telnet or SSH. But this one was sort of text-based, yet you picked fields in it with the mouse or with Tab and filled them in.

Create a file? There are no files in the usual sense. For me it was a real shock. A file has a fixed size, you register it somewhere, it gets created asynchronously, and then you get a notification: file created. The assignment for the credit test went like this: define a VSAM file of data about residents of Latvia in JCL, fill it with DITTO, and write a COBOL program that reads a file of transactions (update, add or delete a record) and writes a log of errors.

We write a program, send it off to compile, wait thirty seconds or so, then a reply comes: compilation succeeded. Where all of it lives, nobody knows. You run it: an error. How to see which one, nobody knows either. No interactivity, nothing at all. Just horrible.

And no one to ask. The teacher walks in a circle: goes up to one student, the two of them poke at something and fix it, and he moves on to the next. And you wait ten minutes or so until he gets to you and explains what to press next.