COBOL–Working With It

Image from Canva, Edited in Canva to add text

The Common Business Oriented Language (COBOL) computer programming language is over 60 years old. Some consider it to be outdated, and those that program in it have been jokingly called dinosaurs. However, COBOL is still widely in use in banks, insurance companies, governments, and other financial institutions to efficiently and securely process large amounts of data through computer programs run on Mainframes. There are basically 2 different forms of COBOL program processing: Batch and Online.

Batch Processing

Batch COBOL programs are scheduled through Job Control Language (JCL) jobs to be run at a specific time, in a certain order. For example, data may be batched in files and processed overnight to update a DB2 database. JCL jobs are set to specify who has access to run the program as well as time parameters. The input data file names are also included in the JCL job, along with the COBOL program name and an output location.

Online Processing

There are CICS (Customer Information Control System) programs that are online COBOL programs containing CICS commands. They are run in real-time for screen display and data capture. For instance, while programs run in the background, screens are displayed to a user to allow data entry. The data captured is processed and saved, possibly to a DB2 database.

Coding Environment

The COBOL coding environment is typically an interactive TSO (Time Sharing Option) session on a Mainframe computer. If you would like more details, IBM has a What is TSO section on their website. Most users work with TSO through its menu-driven interface, Interactive System Productivity Facility (ISPF). What is ISPF is also available through the IBM website.

In summary, COBOL programs are compiled and run in a Mainframe TSO environment, using an ISPF interface. These programs can be set to run on a schedule in a JCL job, using batch processing; or through an online environment, using CICS.

What other COBOL-related items would you like to see explained in more detail?

 

COBOL Plus JCL Equals Magic

Background from Canva, Edited by the Author in Canva

The Initiation

I’ve had a love-hate relationship with Job Control Language (JCL) ever since my first encounter with it back in the 1990s. If you wanted to program in COBOL, which I did, there was no way to avoid JCL. All beginner programmers had to complete a week-long JCL tutorial with information similar to that found in this current IBM Basic JCL Concepts tutorial. Of course, almost 30 years ago, my JCL tutorial was presented on a green screen in a non-graphic, dry way. I probably learned more in my first hour running my own JCL job than I did that whole week reading screen after screen of info that seemingly had no context.

The Effort

At the beginning of your career, which is what it will become if you have the tenacity to continue as a COBOL programmer, you can’t begin to comprehend how much time you will spend with JCL over the years. Early on, you may spend hours trying to figure out why your job isn’t running at all or why it abends in a step when it logically shouldn’t. You pour over the job output looking for clues, only to find that you’ve somehow added an extra space in your Jobcard, or your output file doesn’t exist when your job expects it to.

The Understanding

As time goes on, after you have run a few jobs and debugged a few outputs, it starts to become a bit clearer that there is a method to this madness. Maybe by this time, you have actually written a Batch COBOL program yourself that reads input, perhaps from a file, performs some processing, and writes output to another file. How do you get that program to run and produce that output? You wrap some JCL around it to tell it what file to use as input and where to save the output. Your job may even be scheduled to run at a certain time through a job scheduler like Control-M.

Graphic created by the Author

The Reward

In the end, if you stick with it, it can be a very satisfying experience to understand JCL, create a job, and run it successfully. There is something rewarding, almost magical, about producing JCL that runs your own COBOL program and produces an output that you can see. It took time, but it is a skill that I am happy I have learned and that I use almost daily.

What is your experience with JCL? Did you put in your own effort to come to understand it and, in the end, find it rewarding?