Three Ways to Remotely Call REXX (TSO/E & OPS) Using Zowe CLI

Dan Kelosky
Zowe
Published in
3 min readJul 13, 2022

{Core} Here we’ll show how to invoke TSO/E REXX and OPS/REXX using The Open Mainframe Project’s Zowe CLI via HTTP (z/OSMF), SSH, and FTP.

For each protocol we’ll run a “Hello World” TSO/E REXX program:

TSO/E REXX is the standard z/OS interpreter that comes with the operating system, however for illustration purposes I’ve included samples for mainframe users who have OPS/MVS and are using its interpreter instead.

And for an OPS/REXX program to display system IPL date:

The examples are arbitrary, intended only to demonstrate how larger REXX programs could be called through the same technique.

HTTP (z/OSMF)

Invoking REXX through Zowe CLI is pretty straightforward if you have z/OSMF setup and a zosmf profile (see zowe config init --help for more info) create.

Use zowe tso issue command to run ex (TSO/E REXX) or ox (OPS/REXX ) programs:

Note The ox command is only available if you have have OPS/MVS installed and is for illustration purposes.

Both ex and ox are called from Windows Terminal

SSH

Running through SSH isn’t much different. You need a ssh profile, and then you can invoke ex or ox though the tso command in z/OS Unix. Run zowe uss issue command while properly escaping embedded double quotes:

Both ex and ox are called from Windows Terminal too

FTP

To use FTP and run REXX, you’ll need the zftp plugin installed into Zowe CLI, e.g. zowe plugins install @zowe/zos-ftp-for-zowe-cli. From there you create a zftp profile.

Running REXX is a little indirect through FTP because we’ll submit a batch job to invoke IKJEFT01 and run our programs.

We start with a template JCL, like:

Then use mustache, handlebars, or your favorite scripting language to substitute from the template values to drive whatever program you’d like to run, i.e. ox for example:

Lastly, run the program with zowe zftp submit lf using the --wfo option to wait for output:

We can view output with a follow up command zowe zftp view sfbi (which can be scripted to make both commands run more seamlessly):

Alternatively, using TSO/E REXX (JCL not shown):

Summary

Some mainframe environments might have less options for remote connections than others, but with one of HTTP, SSH, and FTP active, you can still use Zowe CLI.

Finding out more

If you enjoyed this blog, check out more at the Zowe blogs site. Or, ask a question and join the conversation on the Open Mainframe Project Slack Channel #Zowe-dev, #Zowe-user or #Zowe-onboarding. If this is your first time using the slack channel register here.

--

--

Dan Kelosky
Zowe
Writer for

Likes programming/automation in mainframe (assembler, C/C++), distributed (Node.js), and web development (Firebase, Angular).