Chapter 12. REXX General Concepts
The REstructured eXtended eXecutor (REXX) language is particularly suitable for:
v Command procedures
v Application front ends
v User-defined macros (such as editor subcommands)
v User-defined XEDIT subcommands
v Prototyping
v Personal computing.
REXX is a general purpose programming language like PL/I. REXX has the usual structured-programming
instructions—IF, SELECT, DO WHILE, LEAVE, and so on—and a number of useful built-in functions.
The language imposes no restrictions on program format. There can be more than one clause on a line, or
a single clause can occupy more than one line. Indentation is allowed. You can, therefore, code programs
in a format that emphasizes their structure, making them easier to read.
There is no limit to the length of the values of variables, as long as all variables fit into the storage
available.
Implementation maximum: No single request for storage can exceed the fixed limit of 16MB. This limit
applies to the size of a variable plus any control information. It also applies to buffers obtained to hold
numeric results.
The limit on the length of symbols (variable names) is 250 characters.
You can use compound symbols, such as
NAME.Y.Z
(where Y and Z can be the names of variables or can be constant symbols), for constructing arrays and for
other purposes.
REXX programs can reside in REXX File System directories or in VSE sublibraries. REXX programs
usually have a file type of EXEC or, if they are in a VSE Librarian sublibrary, a member type of PROC.
A language processor (interpreter) runs REXX programs. That is, the program is processed line-by-line
and word-by-word, without first being translated to another form (compiled). The advantage of this to the
user is that if the program fails with a syntax error of some kind, the point of error is clearly indicated;
usually, it will not take long to understand the difficulty and make a correction.
Structure and General Syntax
REXX programs are recommended to start with a comment. REXX/CICS does not require this. However,
for portability reasons, you are recommended to start each REXX program with a comment that begins on
the first line and includes the word REXX. The example in Figure 48 illustrates this. The program starts with
a comment and the characters “REXX” are in the first line (line 1).
A REXX program is built from a series of clauses that are composed of:
/* REXX program */
...
...
...
EXIT
Figure 48. Example of Using the REXX Program Identifier
© Copyright IBM Corp. 1992, 2009 109