IBM SC34-5764-01 Server User Manual


 
Continuations
One way to continue a clause onto the next line is to use the comma, which is referred to as the
continuation character. The comma is functionally replaced by a blank, and, thus, no semicolon is
implied. One or more comments can follow the continuation character before the end of the line. The
continuation character cannot be used in the middle of a string or it will be processed as part of the string
itself. The same situation holds true for comments. Note that the comma remains in execution traces.
The following example shows how to use the continuation character to continue a clause.
say 'You can use a comma',
'to continue this clause.'
This displays:
You can use a comma to continue this clause.
Expressions and Operators
Expressions in REXX are a general mechanism for combining one or more pieces of data in various ways
to produce a result, usually different from the original data.
Expressions
Expressions consist of one or more terms (literal strings, symbols, function calls, or subexpressions)
interspersed with zero or more operators that denote operations to be carried out on terms. A
subexpression is a term in an expression bracketed within a left and a right parenthesis.
Terms include:
v Literal Strings (delimited by quotation marks), which are constants
v Symbols (no quotation marks), which are translated to uppercase. A symbol that does not begin with a
digit or a period may be the name of a variable; in this case the value of that variable is used.
Otherwise a symbol is treated as a constant string. A symbol can also be compound.
v Function calls (see page 171), which are of the form:
 symbol(
literal_string(
,
expression
) 
Evaluation of an expression is left to right, modified by parentheses and by operator precedence in the
usual algebraic manner (see section “Parentheses and Operator Precedence” on page 118). Expressions
are wholly evaluated, unless an error occurs during evaluation.
All data is in the form of “typeless” character strings (typeless because it is not—as in some other
languages—of a particular declared type, such as Binary, Hexadecimal, Array, and so forth). Consequently,
the result of evaluating any expression is itself a character string. Terms and results (except arithmetic and
logical expressions) may be the null string (a string of length 0). Note that REXX imposes no restriction
on the maximum length of results. However, there is a 16MB limitation on the amount of a single storage
request available to the language processor. See the note on page 109 for more information.
Operators
An operator is a representation of an operation, such as addition, to be carried out on one or two terms.
The following pages describe how each operator (except for the prefix operators) acts on two terms, which
may be symbols, strings, function calls, intermediate results, or subexpressions. Each prefix operator acts
on the term or subexpression that follows it. Blanks (and comments) adjacent to operator characters have
no effect on the operator; thus, operators constructed from more than one character can have embedded
REXX General Concepts
Chapter 12. REXX General Concepts 115