The OPS/REXX language is a crucial part of the Broadcom OPS/MVS® product that adds to standard REXX a set of extensions to automate and enhance the productivity of z/OS operations. With the OPS/REXX Language Support extension, automation engineers can develop OPS/MVS Automated Operations Facility (AOF) rules and OPS/REXX programs more efficiently by editing OPS/REXX in a local VS Code environment.
OPS/REXX Language Support makes AOF rule and OPS/REXX program development easier by enabling you to
- Use OPS/REXX syntax highlighting to help distinguish the elements of AOF rules and OPS/REXX programs
- Use autocompletion for names of OPS/REXX built-in functions, host environments, and AOF event variables
- Get hover help on OPS/REXX built-in functions, host environment names, and AOF event variable names
- Get basic error checking for AOF rule and OPS/REXX syntax
- Copy from a library of frequently used OPS/REXX rule snippets
- Issue selected OPS/MVS commands to perform common rule actions and execute OPS/REXX programs
The OPS/REXX Language Support extension does not provide the ability for you to download from or upload to the mainframe. To access mainframe code while using OPS/REXX Language Support, we recommend Zowe Explorer (see Recommended Software) or Zowe CLI.
The OPS/REXX Language Support extension has no prerequisite software. However, for your best experience with OPS/REXX Language Support, we recommend the following software.
For correct display of syntax highlighting, we recommend using OPS/REXX Language Support with a REXX language support extension. OPS/REXX Language Support has been tested for compatibility with the Broadcom REXX Language Support extension.
We recommend using Zowe Explorer to access mainframe code while using OPS/REXX Language Support. For more information about the Zowe Explorer extension, see Zowe Explorer on the VS Code marketplace.
We recommend establishing a connection with your mainframe OPS/MVS instance using the OPS/MVS REST API. Using the REST API along with a Zowe Explorer profile containing connection information allows you to issue OPS/MVS commands and invoke OPS/REXX programs from within VS Code.
Although it is possible to use OPS/REXX Language Support without access to OPS/MVS, most users will want to use the extension while interacting with an OPS/MVS instance. To configure OPS/REXX Language Support for use with OPS/MVS:
-
Ensure that your instance of OPS/MVS is configured with the OPS/MVS REST API (OPSREST) component.
-
In the OPS/REXX Language Support extension settings, set the
Subsystem
parameter to the default subsystem for the OPS/MVS instance you are using. If you want, you may also set default values for your program command parameters. -
Create a team configuration file containing the connection information for the OPS/MVS instance you would like to connect to. Use one of the following methods:
-
Use Zowe Explorer to create a team configuration file. Provide the following information:
- The host name of the LPAR on which the REST API is running.
- The port number for the REST API.
- A username that has authority to access the REST API.
- The password to the account that is associated with the username.
-
Follow these steps to manually create a team configuration file.
-
-
When you are working with OPS/REXX files, ensure their file extension is
.opsrexx
to automatically enable OPS/REXX Language Support Extension features. For more information, see Configuring OPS/REXX Language Support for Zowe Explorer.
- If you are using the OPS/REXX Language Support extension with multiple OPS/MVS instances running on different systems, install and configure the OPS/MVS REST API on each system in your OPSplex. One instance of the REST API is required for each system.
- When you have multiple instances of OPS/MVS running on a single system, only one instance of the REST API is required.
OPS/REXX programs and rules will be automatically recognized as .opsrexx
files upon opening in VS Code when the first line of the file contains either the comment /* OPSREXX */
or a rule type identifier, such as )CMD
or )MSG
(case-insensitive).
To ensure that data sets not containing those first lines and accessed through Zowe Explorer are recognized by the extension as .opsrexx files, you must create a file association in your VS Code settings.
To create a file association:
- On the VS Code menu bar, click
File
,Preferences
, and clickSettings
to display the Settings editor. - Select the
User
orWorkspace
tab, depending on which settings you want to update (User
settings are your personal settings for customizing VS Code and apply to all files globally,Workspace
settings are specific to a project and override user settings. Check the VS Code documentation for more information). - Scroll down to or search for the Files: Associations setting and click Add Item.
- Add
**/*QUALIFIER*{,/*}
to the Key field, andopsrexx
to the Value field whereQUALIFIER
is the portion of the fully qualified data set path you want to be automatically set as an OPS/REXX file type.- For example, if you have a fully qualified data set called
OPSS.CCLXSAMP.SAMPLE.RULES
, you could put**/*RULES*{,/*}
or**/*CCLXSAMP*{,/*}
in the key field to automatically associate all files in any data set with the matching qualifier.
- For example, if you have a fully qualified data set called
After completing these steps, you can use Zowe Explorer to access .opsrexx
files.
Use OPS/REXX syntax highlighting and symbol resolution to help you avoid syntax errors when developing rules.
Place and hold your cursor over an OPS/REXX element to view more information about it. Hover insights are available for OPS/REXX built-in functions, host environments, or AOF event variable names.
To trigger autocompletion of AOF variables, type .
after an AOF rule type stem, for example: msg.
AOF variable completions are supported for all rule types.
Variable autocompletion is triggered automatically when you type an OPS/REXX built-in function or host environment name.
OPS/REXX Language Support automatically performs some basic error checks on AOF rule and OPS/REXX program syntax, such as the line length warning shown in the following image.
Using snippets promotes consistent and correct syntax in the rules you design. Before you write AOF rules from scratch, check the snippet library for any applicable rule snippets.
To use the snippet library:
- Open the VS Code command palette by pressing
Ctrl/Cmd + Shift + P
. - Type
Insert Snippet
. - Click the command or press Enter.
- Choose the type of rule snippet you want to insert.
- Fill in the templated values to complete the OPS/REXX rule.
For a quicker way to access the snippets:
-
Begin typing the name of a snippet (such as
)MSG
) in the editor.VS Code autocomplete suggests the full name of the snippet.
-
Select the suggested snippet and press Enter.
To issue OPS/MVS commands from OPS/REXX Language Support, you need an OPS/MVS REST API connection. Configure the OPS/REXX Language Support extension for the connection as described in Configuring OPS/REXX Language Support for OPS/MVS.
You can use OPS/REXX Language Support to issue the following OPS/MVS commands:
Show Rule Status
- Shows the status of a selected rule.Enable Rule
- Enables a selected rule.Disable Rule
- Disables a selected rule.Execute Program
- Executes a selected OPS/REXX program using your default OPS/MVS subsystem.Execute Program with Parameters
- Executes an OPS/REXX program that you choose by typing parameters into an input form.
To issue OPS/MVS commands, use one of the following methods.
- In the Zowe Explorer sidebar of the VS Code application window, browse for and open the file containing the rule or program you want.
- Type
Ctrl/Cmd + Shift + P
to open the VS Code command palette. - Select the command you want from the menu.
Tip: The OPS/MVS: Execute Program with Parameters command can be used from the VS Code command palette regardless of which file is currently open.
- In the Zowe Explorer sidebar of the VS Code application window, right-click on the icon representing the rule or program you want.
- From the pop-up menu, select the command you want.
After a command is issued, the VS Code window displays a status message. If a command fails, a detailed error message displays.
See the following videos for examples of issuing commands.
Execute Program with Parameters (Key binding Ctrl + Shift + E
)
You can use Zowe Explorer to copy OPS/MVS automation samples to your own library, then use the OPS/MVS Language Extension to develop and manage the samples. See the following videos for examples of this use case.
You can find a complete listing of the automation samples included with OPS/MVS here.
Copyright © 2024 Broadcom. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries.