Chapter 19: REXX Support

This chapter describes how REXX is supported.

Introduction

REXX is a high-level language with extensive facilities for manipulating text. CLISTs are not supported under reUZE Server so we recommend that you convert your CLISTs to REXX programs.

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 **************/

REXX execs should have the file extension .rex.

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.

MSS assumes that your execs are in the same location as your JCL applications, that is, the location specified in JES Program Path on the Edit Server > Properties > JES page.

MSS interprets an exec as it is run. There are no preceding compilation and linking stages.

MSS supports the use of REXX execs only in the JCL (non-TSO) environment. This can be used for execs that do not need interaction with the user and do not need access to TSO services.

JCL Environment

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
/*
//

Passing Parameters

You can pass parameters to a REXX exec in the usual way, for example:

In the exec named add, you can use an ARG instruction to receive the two parameters, 42 and 21.

Including Host Commands

You can include a host command in a REXX exec by enclosing it in quotation marks, for example:

"EXECIO * DISKR MYINDD (FINIS STEM MYVAR"

The REXX language processor passes the command and any other source code that it does not recognize to the host command environment for execution.

MSS emulates the MVS host command environment. If you use a host command that is not recognized by the 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.

Debugging an Exec

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 TRACE instruction lets you start and control the debugging facility from within an exec.

Specifying Record Length for Zero-length Line Sequential Files

The MFREXX_LSEQ_RECSIZE_MAX environment variable enables you to specify the record length for the REXX EXECIO command when reading or writing a line sequential file that has been cataloged with a record length of zero.

You should set the environment variable before you start the enterprise server in the Configuration Information field on the Add Server or Edit Server pages of ES Admin, as follows:

[ES-Environment]
MFREXX_LSEQ_RECSIZE_MAX=rec-length

Alternatively, you can set in on the command line before you start the enterprise server:

SET MFREXX_LSEQ_RECSIZE_MAX=rec-length

where rec-length is the record length to use. The default is 255, which is the minimum value you can use. Specifying an invalid value, or a value less than 255, results in the default value being used.

Specifying Alternative Characters for the OR and NOT Operators

If you need to use characters other than the defaults for REXX's OR and NOT operators, MSS enables you to do this using two environment variables: MFREXX_OR and MFREXX_NOT. You must set these environment variables before you start the enterprise server for them to take effect, either in the Configuration Information field on the Add Server or Edit Server pages of ES Admin or on the command line.

You can specify one or more characters for each operator, and each character you specify is used in addition to the default operator; that is "|" for OR and "¬" for NOT. When specifying additional characters, you must ensure that each additional character is defined in single or double quotes, or in hexadecimal. When specifying more than one character, separate each one with a space or comma. Any error in the specification of the additional characters, including the specification of alphabetic or numeric characters, results in the environment variable being ignored.

Examples:

[ES-Environment]
MFREXX_NOT="^"
MFREXX_NOT=0x5e "!"
MFREXX_NOT=X'5e' '!' "~" 

Restrictions

The following mainframe REXX facilities are not supported by MSS:


Copyright © 2008 Micro Focus (IP) Ltd. All rights reserved.