|JCL Support||Overview of Testing|
REXX is a high-level language with extensive facilities for manipulating text. REXX programs can also include host system commands and so can be used in place of TSO CLISTs.
This chapter describes how REXX is supported in Mainframe Express. For more information about the REXX language and how it is used, see the IBM OS/390 TSO/E REXX Reference and IBM OS/390 TSO/E REXX User's Guide.
A REXX program is called an exec. Before running an exec, you need to add the exec to your project, or download it from the mainframe, in the usual way. All REXX execs should start with a comment containing the character string REXX so that they can be distinguished from TSO CLISTs. For example:
/************** REXX **************/
On the PC, REXX execs should have the file extension .rex. By default, they are placed in the REXX source library in the Workgroup location.
Optionally, you can define an exec as a member of a partitioned data set (PDS). The DD names SYSEXEC and SYSPROC are normally used for PDSs containing REXX execs. More than one PDS can be allocated to each of these DD names. A SYSEXEC PDS can contain only execs. A SYSPROC PDS can contain CLISTs and execs.
When you run the exec, if you do not specify the location of the exec explicitly, Mainframe Express uses the following search order to locate it:
Mainframe Express interprets an exec as it is run. There are no preceding compilation and linking stages.
Mainframe Express supports the use of REXX execs in the following host environments:
In the TSO interactive environment, you can run a REXX exec in the same way as a CLIST. You can specify the exec that you want to run:
For example, if the exec is named tsotest and is a member of a private PDS named userid.rexx.exec, you can specify one of the following forms:
ex 'userid.rexx.exec(tsotest)' exec
ex rexx.exec(tsotest) exec
ex rexx(tsotest) exec
The final exec keyword identifies it as a REXX exec. You can omit it if the first line of the exec is a comment containing the character string REXX.
If the exec is a member of a PDS allocated to SYSEXEC or SYSPROC, or if SYSEXEC and SYSPROC are not defined but the REXX exec is included in the project, you can simply specify one of the following:
You can use the IKJEFT01 utility to set up a TSO batch environment and run a REXX exec in the same way as a CLIST.
For example, the following JCL jobstream runs the REXX exec named tsotest in the PDS named userid.rexx.exec.
//jobname JOB ............ //* //jobstep EXEC PGM=IKJEFT01,......... //SYSEXEC DD DSN=USERID.REXX.EXEC,DISP=SHR //SYSTSPRT DD SYSOUT=A //SYSTSIN DD * %TSOTEST /* //
You can run the JCL jobstream from the Debug menu in the usual way.
In the JCL environment, you can use the IRXJCL utility to run a REXX exec.
For example, the following JCL jobstream runs the REXX exec named jcltest in the PDS named userid.rexx.exec that has been allocated to SYSEXEC.
//jobname JOB ............ //* //jobstep EXEC PGM=IRXJCL,PARM='JCLTEST' //SYSEXEC DD DSN=USERID.REXX.EXEC,DISP=SHR //SYSTSPRT DD SYSOUT=A //SYSTSIN DD * input to exec /* //
You can pass parameters to a REXX exec in the usual way, for example:
rexx(add) 42 21 exec
add 42 21
%ADD 42 21
//jobstep EXEC PGM=IRXJCL,PARM='ADD 42 21'
In the exec named add, you can use an ARG instruction to receive the two parameters, 42 and 21.
You can include a host command in a REXX exec by enclosing it in quotation marks, for example:
"ALLOCATE FILE(SYSUT1) DATASET('TSODEMO.DATA.TESTDATA') SHR"
The REXX language processor passes the command and any other source code that it does not recognize to the host command environment for execution.
Mainframe Express emulates the TSO and MVS host command environments. It selects the appropriate environment by default on entry to a REXX exec. TSO is selected for the TSO interactive and batch environments and MVS is selected for the JCL environment. If you use a host command that is not recognized by the current environment, the return-code variable RC is set to -3.
You can use the ADDRESS built-in function to find the name of the current environment and the ADDRESS instruction to change it.
You can use the REXX debugging facility to help you debug an exec. It lets you interact with the exec while it is running and monitor the values of variables.
The following mainframe REXX facilities are not supported by Mainframe Express:
All the other variables normally set by LISTDSI are set to a NULL string.
All the other variables normally set by MVSVAR are set to a NULL string.
All the other variables normally set by SYSVAR are set to a NULL string.
All other options are treated as NOPs.
Copyright © 1999 MERANT International Limited. All rights reserved.
This document and the proprietary marks and names used herein are protected by international law.
|JCL Support||Overview of Testing|