So this happened on Twitter

image

Which of course led me to write this post showing off a little of the language (just a little).

But before I show you the awesomeness that is RPG-II, let me talk a little about the background to this story. I was going through uni to get my computer science degree and my Dad managed to land me an holiday job where I could write some ‘real world’ code and get some experience. The application I needed to write was a cyclic stocktake for a warehouse management system. It would select a user defined number of random locations in the warehouse that hadn’t been counted recently, print out a count sheet for the warehouse staff to use, provide a screen for entering those counts and another report to go show the variances.

I had to write this on a Wang VS midframe. Of course, the machine needed to be in it’s own air conditioned room, on a raised floor, running on 3-phase power. A bit like this one, though a different model:

image

(image via http://community.fortunecity.ws/roswell/goldendawn/232/WangComputers1.htm)

It had a reel-to-reel tape drive that took 1200’ tapes and needed the lid closed before it would spin up,

image

(Image via http://www.ricomputermuseum.org/Home/equipment/wang-peripherals/wang-2248v-1-9-track-tape-drive)

and had removable drives that took 9” “data cartridges” like this one

image

(image via http://ripsaw.cac.psu.edu/~mloewen/Oldtech/Media/RigidDisk.html)

To code on this beastie I used an 80 column green screen Wang terminal:

image

(image via http://www.ricomputermuseum.org/Home/equipment/wang-vs45)

and, of course, I had to code in RPG-II. The fact that at University I was coding in Pascal and C++ using a mix of Macs and Solaris made this feel like a step back in time.

What’s different about RPG-II, you ask? Well, it’s a column formatted language for one. You think a whitespace significant language like Haskell and Python can be confusing, try having each column have different meanings and woe betide you if you get your columns wrong and things don’t compile. That sounds like fun, right?

This is structured programming that takes the word ‘structured’ to the extreme. So much so that the programming manual (http://www.scribd.com/doc/75247909/Rpgii-and-Sys36) included grid paper style code samples so you could understand the syntax better:

image

In the end you end up with code that looks something like this (and yes, you needed to use GOTO statements)image

Pretty awesome right? It’s only just a slight step above assembly programming! If you have a few minutes go and read the Wikipedia article for a quick run down on the main parts of the language. It’s an interesting approach to language design and the limitations of the hardware and terminals they were working with.

As it turns out, my first full time job ended up being with this company and the Wang VS was being replaced with the thoroughly modern and completely brilliant Digital VAX/VMS when I joined. It meant I ended up writing code in VAX BASIC and not once missing the RPG-II language. And those Wang terminals? We replaced those with VT420s and Wyse WY50 terminals.  Now we could have our green screens in orange as well if we wanted! Superb!

Side note: RPG-II isn’t the most esoteric language I ever coded in. For one job I wrote in a thing called ‘English Application Language’ (EAL), a variant of COBOL developed by Cyborg Systems for payroll applications. But that’s a different story for another time.

Leave a comment with oldest language you’ve ever coded in!