Making REXX code changes

In addition to COBOL, PL/I, and High Level Assembler (HLASM), IBM Z® Open Editor supports TSO/E REXX editing. You can use the following features to edit REXX programs effectively.

With the syntax highlighting capability, you can quickly distinguish the comments, strings, constants, variables, keywords, labels, functions, comparison, and arithmetic in a REXX 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 internal routines, and directly navigate to one by selecting it.

REXX Outline

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 that 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.

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, compound symbols, stems, function calls, 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.

Code Completion

How to use it

The code completion suggestion is displayed automatically while you are typing outside of any comments or strings.

Hovering for declaration

The hover feature provides rich information about keyword instructions and built-in functions. By moving your cursor over these elements, a small pop-up window is displayed containing a title, description, and example usage.

REXX Hover

How to use it

You can see hovers for keyword instructions and built-in functions by moving your cursor over the element. The hover disappears when your cursor moves elsewhere.

Previewing include control directives

To preview the contents of a %INCLUDE statement, point to the file name. If the file cannot be resolved, a red warning underline will appear on the file name. To open the file in a separate editor, press Ctrl and click (on Windows), or press Cmd and click (on Mac).

REXX INCLUDE File Preview

How to use it

To resolve include files, you must specify the filepath to the include files in your ZAPP file property groups to resolve the references. The location can be a local one such as another directory in your workspace, or it can be an MVS data set on a remote z/OS system using Zowe connectivity to find and load the files.

If no filepath is specified, the include files are not found in the provided filepath and an error is shown. To resolve this, follow the instructions provided and our ZAPP overview and Property Groups pages.

Operations on symbols

By right clicking on a symbol, you can see a list of available operations.

How to use it

  • Click Find All References: Alt+Shift+F12 (Windows) or Option+Shift+F12(Mac)
  • Click Peek References: Shift+F12 (Windows and Mac)

A reference is defined as any matching symbol not in a comment or string. Keywords and built-in functions do not appear as references. The matches are determined by the context of the symbol. Internal routines match to their calls. Stems match to other stems. Simple symbols match to other simple symbols. Constant symbols match to other constant symbols. For compound symbols, the tail is broken into separate pieces, delimited by its periods, and matched to other constant or simple symbols. Additionally, the derivation and scope of a symbol is not considered.

REXX PEEK REFERENCES

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 at the bottom in the status bar. Double-click the list item to directly go to the problem.

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 REXX 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:

rexx toggle comment

Last Updated:
Contributors: Bradley Knaysi, Greg Lambert, Saile Daimwood, Chun Hong Zheng, Peter Haumer