A Modern JCL (Job Control Language) Editor
by Prasang Prajapati
18 June 2024
In the ongoing effort to bring z/OS® application development into the rich ecosystem of modern code editors, the JCL (Job Control Language) programming language is the next major addition. Enabled in IBM Z® Open Editor 4.3.0 and IBM® Wazi Developer 4.3.0, you will be able to benefit from our Language Server Protocol (LSP) implementation for JCL. This brings a plethora of language features to the editor, which make JCL development easier and more accessible.
There are several language features now available to augment the JCL editing experience.
Syntax highlighting
Arguably the most important of the bunch, the colorization of code is hard to go without these days. It's quite surprising how far a little color variance can go to make distinguishing symbols easier. Bringing visual clarity to the syntactically wild JCL programming language, this feature undeniably improves the speed and precision of development.
Syntax errors
Out of the many mainframe programming languages, JCL is truly the free spirit. Job control language (JCL) is used to tell the system what program to execute, followed by a description of program inputs and outputs. Basic JCL contains three types of statements: JOB, EXEC, and DD. A job can contain several EXEC statements (steps) and each step might have several DD statements. JCL provides a wide range of parameters and controls, but you will find that you use only a subset most of the time. Making a small typing mistake in adding mentioned JCL statements can lead to a major failure in submitting a JOB about which z/OS resources will be needed to process a batch job pr to start a system task. Syntax errors in an editor can help users identify mistakes that have been made in the program easily.
Code completion
Writing code can be a tedious process, and one that requires incredible memory and focus. Some of the simplest mistakes are misspelled statements, and given that JCL does not require JOB statement before steps (EXEC statement), these spelling errors can go completely unnoticed until some strange runtime errors occur. To alleviate this problem, you can utilize code completion to see INCLUDE statement, JCL Library statement, JOB statement, PROC statements and much more as you type. This incredibly powerful feature gives you the confidence to know that the symbol you type is the right one.
Outline view
A highly underrated feature, the outline view provides an overview of a program. We did the research, studying real JCL developers, to find out how to make this feature actually useful. What we found, it can be a powerful navigation tool for quickly going a step (an EXEC statement). Instead of crowding the outline view with every EXEC statement to find a DD statement that is inside a step, it was significantly more useful when users could glance over and see what EXEC and DD statements were defined in a JOB, and if they wanted, navigate there with one click.
Commenting and uncommenting JCL code
You can comment out one or multiple selected lines of code or a selected section of code by using the toggle comment function.
How to use it
To toggle comment for one or multiple selected lines of code, press Cmd+/ (Mac) or Ctrl+/ (Windows), or go to Edit > Toggle Line Comment
.
To toggle comments for a selected section of code, press Option+Shift+A (Mac) or Alt+Shift+A (Windows), or go to Edit > Toggle Block Comment
.
See the following example where we first toggle line comment on a single line, then toggle line comment on multiple selected lines, and finally toggle block comment on a selection:
More information
For information about how to utilize the different language features, see Making JCL code changes.