What Is A Rexx Exec - IBM TSO/E REXX User Manual

Table of Contents

Advertisement

Before You Begin
TSO/E ALLOCATE command. For specific information about allocating a data set
for an exec, see "Appendix A. Allocating Data Sets" on page 185.

What is a REXX Exec?

A REXX exec consists of REXX language instructions that are interpreted directly
by the REXX interpreter or compiled directly by a REXX language compiler and
executed by a Compiler Runtime Processor. An exec can also contain commands
that are executed by the host environment.
An advantage of the REXX language is its similarity to ordinary English. This
similarity makes it easy to read and write a REXX exec. For example, an exec to
display a sentence on the screen uses the REXX instruction SAY followed by the
sentence to be displayed.
Note that this simple exec starts with a comment line to identify the program as a
REXX exec. A comment begins with /* and ends with */. To prevent
incompatibilities with CLISTs, IBM recommends that all REXX execs start with
a comment that includes the characters "REXX" within the first line (line 1) of
the exec. Failure to do so can lead to unexpected or unintended results in
your REXX exec. More about comments and why you might need a REXX exec
identifier appears later 14.
When you run the exec, you see on your screen the sentence:
Even in a longer exec, the instructions flow like ordinary English and are easy to
understand.
When you run the example, the exec interacts with you at the terminal. First you
see on your screen:
8
z/OS V1R1.0 TSO/E REXX User's Guide
Example of a Simple Exec
/**************************** REXX *********************************/
SAY 'This is a REXX exec.'
This is a REXX exec.
Example of a Longer Exec
/**************************** REXX *********************************/
/* This exec adds two numbers and displays their sum.
/*******************************************************************/
SAY 'Please enter a number.'
PULL number1
SAY 'Now enter a number to add to the first number.'
PULL number2
sum = number1 + number2
SAY 'The sum of the two numbers is' sum'.'
Please enter a number.
*/

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents