Making JCL code changes
In addition to COBOL, PL/I, REXX, and High Level Assembler (HLASM), IBM Z® Open Editor supports z/OS MVS JCL editing. You can use the following features to edit JCL programs effectively.
With the syntax highlighting capability, you can quickly distinguish the comments, job, step (exec) and DD statements in a JCL program.
The editor provides the following features and capabilities:
Browsing code by using the Outline view
As you view the source, you can use the Outline view to efficiently explore and navigate the code of the program. By looking through the items in this view, you can see the Jobs, Steps, DD statements and directly navigate to one by selecting it.
How to use it
You can use the Outline view only after you have opened a file or program. If the Outline view is not already expanded, you can open it by clicking View > Open view > Outline.
You can use this view to:
- Recognize internal routines quickly via the icons in the outline view.
- Go to a wanted location in the code by clicking the section header in the view.
- Sort by Position or Name.
- Search for identifiers within the outline by pressing Ctrl+Shift+O (Windows), or Cmd+Shift+O (Mac) within the Editor window.
- Select the entire step/job/DD statement by double clicking on the symbol in the outline view.
When you move your cursor over the program, outline nodes are automatically selected. To toggle this and other features related to the Outline View, hover over the upper right corner of the Outline View. You can see the option ..., where you can click to find multiple options to organize your outline view such as Follow on Cursor, Filter by Type and Sort by Name, Position, and Type.
Code completion
The code completion feature suggests simple symbols, constant symbols, jobs, steps, DD statements, keyword instructions, and built-in functions. The editor applies a suggestion to the file based on the context of the cursor position. For a cursor position inside a stem, the suggestion replaces the entire symbol. For a cursor position inside the tail of a compound symbol, the suggestion replaces a segment of the symbol. The casing of the suggestion replaces the casing of the symbol in the file. The code completion suggestions are not filtered by case.
How to use it
The code completion suggestion is displayed automatically while you are typing outside of any comments or strings.
Syntax checking
The syntax checking feature underlines unrecognized statements and expressions in red, which helps you to make quick corrections and reduce compile errors.
How to use it
To see all the syntax errors in the open files, open the Problems view through the View menu or by clicking the error and warning icon in the status bar. Double-click the list item to directly go to the problem.
Previewing include files
You can preview the contents of an include file by moving your mouse cursor over the include file name in an INCLUDE MEMBER
statement, without having to navigate away from the file you are working in. To open the file in a separate editor, press Ctrl+Click (Windows) or Cmd+Click (Mac).
On-hover data set name resolution
You can preview the dereferenced value of a data set when hovering over the DSN statement. The SET values in the file are used to dereference the data set name.
JCL Code Folding
Code folding is a feature that allows users to show or hide logical sections of the JCL source code, which makes it easier for users to focus on the code they are working on. Logical sections of JCL source code includes JOB, EXEC, and DD statements.
How to use it
You can fold regions of JCL source code using the folding icons in the gutter between the line numbers and line start. Move the mouse over the gutter and click to fold and unfold regions. Use Shift + Click
on the folding icon to fold or unfold the region and all regions inside. For more detailed information about code folding, refer to the VS Code code folding documentation.
JCL code folding is enabled by default. To disable it use the setting zopeneditor.jcl.enableCodeFolding
.
Undoing and redoing
Undo your changes by pressing Ctrl+Z (Windows) or Cmd+Z (Mac). Redo your changes by pressing Ctrl+Shift+Z (Windows) or Cmd+Shift+Z (Mac).
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: