Showing posts with label Opening dataset in edit mode. Show all posts
Showing posts with label Opening dataset in edit mode. Show all posts

Monday, August 22, 2016

REXX: How to Execute a REXX inside a REXX

It is possible to execute a REXX inside another REXX using the EXEC command.

For example, we shall use this approach to Read the pdsname and member name and pass this information to an another REXX procedure which will work upon this file and produce an output file. We shall open that output file and show it to the user using the outer REXX.

Lets us name the REXX reading the PDSNAME and Member Name as REXX 1.

Lets us name the REXX processing the member as REXX 2.

Rexx 1 should call the REXX 2 using the following code

"EXEC 'Dataset where REXX 2 is residing' '"Input-file"'"  

Rexx 2 will process the Input file and produce an output file.

This output file could be opened from REXX 1 and displayed to the user using the following code.

ADDRESS ISPEXEC "EDIT DATASET("OUTPUT-FILE") "

In case of queries, please post in the comments.

Featured Post

REXX Skeleton: Submitting jobs through Rexx

Submitting jobs through REXX and reading the spool through REXX gives us immense potential to automate many manual activities in mainframes....