The Language Environment has matured in the past decade. So has COBOL. IBM calls its Big Iron COBOL dialect Enterprise COBOL nowadays. And yes, it’s enterprise and operating system ready. 

Quick Take on the Language Environment and z/OS

Many people who write COBOL code on z/OS and other mainframe operating systems remain oblivious to the power and purpose of Language Environment (LE). This is fine, but a quick look at how LE works—in conjunction with the operating system—is certainly worthwhile.

A recent upgrade situation at our site helps illustrate just how tightly coupled the LE and its compile/run-time are to z/OS.

We were migrating from z/OS V1R11 to V1R13. Along with this, an upgrade from Enterprise COBOL V3R4 to V4R2 was planned. The first thing we tried while still on z/OS V1R11 was compiling a simple batch COBOL program using the V4R2 compiler libraries with the z/OS V1R13 LE libraries. An attempt to run this simple COBOL program under z/OS V1R11 failed miserably.

That’s the bad news. The good news was that the LE abort message was as clear as a bell. It stated that we were running with an incompatible version of LE based on the V1R11 version of the operating system.

Our takeaway was that the static V-type constants (V-Cons) produced by all LE compilers were at a higher level of z/OS. We simply transmitted the load module of the V4R2 COBOL program to a z/OS V1R13 test machine and it ran perfectly.

This is an important point to note for all LE/COBOL sites: LE compile/run-times are now a critical component of the operating system.

COBOL: A Full-Fledged LE Player

Here we examine an LE-powered COBOL program that automatically detects a table overflow and then acquires heap storage using LE services to store the overflow data (see Figure 1; Download the Full Program). 

The program isn’t complex and, in fact, only demonstrates how to use LE services from within COBOL to accomplish something that in years past could never have been accomplished. The program simply reads a flat input file and moves the 80-byte input records to a table. This technique was used to make the testing and demonstration process simple. To force the overflow, you must have more than five records at the DD name INFILE. Further, the open-ended nature of the technique demonstrates that a large number of overflow entries can be accommodated. 

4 Pages