REXX exec
A REXX program kept as a member in a library, and run by name.
Also written exec, EXEC library, SYSEXEC
Why it matters. Teams keep their small tools as execs. You run one with a single command, and often never read the code.
See it
An exec is a REXX program stored as a dataset member.
Syntax
EXEC 'dataset(member)' ['parameters'] [EXEC] %member-name (implicit, from SYSEXEC or SYSPROC)
- dataset(member)
- The library and the exec in it.
- 'parameters'
- Text passed to the exec as its argument.
- EXEC
- Tells TSO the member is REXX, not a CLIST.
- %
- Run by name without EXEC, when the library is in SYSEXEC or SYSPROC.
Try it EXEC
- 1
Look at what is in your DEV REXX library.
LISTDS 'ZB0001.DEV.REXX' MEMBERS - 2
Run the exec HELLO.
EXEC 'ZB0001.DEV.REXX(HELLO)' - 3
Now run an exec that is not there: NOSUCH.
EXEC 'ZB0001.DEV.REXX(NOSUCH)'
Remember
- A REXX exec is a member in a library.
- EXEC 'library(member)' runs it. EX is the short form. The first line should be /* REXX */, or you add the word EXEC to the command.
- What you see is whatever the exec SAYs.
The usual mistake
EXEC 'ZB0001.DEV.REXX'
It needs a member. A library on its own is a folder of execs, not one exec.
EXEC 'ZB0001.DEV.REXX(HELLO)'
On real z/OS
Real TSO finds an exec by name through the SYSEXEC and SYSPROC libraries of the logon procedure. MF/OS doesn't model those, and looks in its REXX library under your prefix. Its message for a missing member is its own.
Where can I practise REXX exec?
Right here, at ZedBank. You take a junior job at a simulated bank and use REXX exec in real work, with Zed beside you. There's nothing to install.
Start at ZedBankRelated
- REXXA readable scripting language used across the mainframe for automation, tooling and quick one-off tasks.
- MemberOne named item inside a partitioned dataset, such as a single program, job or copybook within a library.
- Partitioned datasetA dataset that works like a library or folder, holding many separately named members inside one dataset.
- TSO commandA command typed at a TSO prompt or on an ISPF command line to ask the system to do something directly.
- ISPFThe full-screen, menu-driven workbench most people use to do their day-to-day work on z/OS.