Find Related products on Amazon

Shop on Amazon

Tales from Mainframe Modernization

Published on: 2025-06-27 16:01:46

/ / At my last workplace, I wrote transpilers (or just compilers if you prefer) from mainframe languages (COBOL, JCL, BASIC etc.) to Java (in Rust!). Legacy code is full of surprises. In the roughly 200k lines of COBOL that I had the (dis)pleasure of working with, I saw some wonderful hacks to get around the limitations of the system. Mainframes are also chock full of history. Base-10 numerics This is the first thing that stood out to me when I looked at COBOL code, a data-definition (the phrase for “variable”) in COBOL is declared like so: ,-- name | ,- type __|___ __|_ 01 HEIGHT PIC 9(3). -- --- | | | `- picture clause (keyword) `- level number That statement declares a variable called HEIGHT with type 9(3) , which is shorthand for 999 , which indicates “3-digit number”. The possible values for this variable are 0 to 999 ! Internationalisation Below is another data-definition in COBOL, declaring 3 variables: 01 FOO-PERSON. 05 FOO-NAME PIC X(5). 05 FOO-HEIGHT PIC 9(3). What ... Read full article.