Make your own free website on

Sample REXX Code

Our scheduling product includes a TEST function that can be used to evaluate a date expression such as "Friday plus 2 weeks". This EXEC takes a date expression as input, invokes the TEST function and extracts the date value from the returned result. It can be invoked from the command line or as a REXX function.
An interactive REXX interpreter for MVS. Dumb but cheap! If you have it in your SYSEXEC/SYSPROC concatenation, you can type things like REXX SAY X2D(ABC2) - hex to decimal conversion from the command line!
A function that reads the directory from a PDS and returns member information on the REXX stack. See sample EXEC DODIR for an example of the use of this function.
displays the arguments as seen by REXX. See OMVS Shell Programming for an example.
scans BookManager/Read MVS bookshelves for book titles containing a specified string
given a URL, it retrieves the header information for the document. This EXEC uses the REXX socket interface of IBM's TCP/IP OS/390. Inspired by "TCP/IP Socket Programming with REXX" located on an earlier edition of IBM's REXX tutorial page.
an example of using SDSF to retrieve information for the current job. This EXEC locates JCL SET statements in the JCL input dataset. It needs to be run from TSO in batch.
invokes LISTDSI to return volume information for a dataset - copes with multi-volume disk datasets
recall all migrated datasets for a specified mask, e.g. RECALLVL MY.GDG.BASE.**. Unless a second parameter of Y is specified following the DSN mask, the EXEC only reports what recalls would have been issued.
load input REXX code from DDNAME REXXIN and run it. This REXX needs to be in the SYSPROC concatenation since it allocates SYSEXEC. It is meant to be invoked from TSO in batch.
demonstrates when you might wish to use == rather than the = operator in comparisons of string values. Worth keeping in mind.
an example of using the SUBCOM command to determine if a specified subcommand environment is available. For example, ISPEXEC is supported when a REXX EXEC is invoked in an ISPF environment.
an example of using the FTPAPI on z/OS.
Back to the main REXX page here

Some examples formerly on this page have moved to the z/OS internals REXX page.
Big Iron