If a symbol does not begin with a digit or a period, you can use it as a variable and can assign it a
value. If you have not assigned it a value, its value is the characters of the symbol itself, translated
to uppercase (that is, lowercase a–z to uppercase A–Z). Symbols that begin with a number or a
period are constant symbols and cannot be assigned a value.
One other form of symbol is allowed to support the representation of numbers in exponential
format. The symbol starts with a digit (0–9) or a period, and it may end with the sequence E or e,
followed immediately by an optional sign (- or +), followed immediately by one or more digits
(which cannot be followed by any other symbol characters). The sign in this context is part of the
symbol and is not an operator.
These are valid numbers in exponential notation:
17.3E-12
.03e+9
Implementation maximum: A symbol can consist of up to 250 characters. But note that its value,
if it is a variable, is limited only by the amount of storage available. See the note on page 109 for
more information.
Numbers:
These are character strings consisting of one or more decimal digits, with an optional prefix of a
plus or minus sign, and optionally including a single period (.) that represents a decimal point. A
number can also have a power of 10 suffixed in conventional exponential notation: an E
(uppercase or lowercase), followed optionally by a plus or minus sign, then followed by one or
more decimal digits defining the power of 10. Whenever a character string is used as a number,
rounding may occur to a precision specified by the NUMERIC DIGITS instruction (default nine
digits). See pages 217-224 for a full definition of numbers.
Numbers can have leading blanks (before and after the sign, if any) and can have trailing blanks.
Blanks may not be embedded among the digits of a number or in the exponential part. Note that a
symbol (see preceding) or a literal string may be a number. A number cannot be the name of a
variable.
These are valid numbers:
12
'-17.9'
127.0650
73e+128
' + 7.9E5 '
'0E000'
You can specify numbers with or without quotation marks around them. Note that the sequence
−17.9 (without quotation marks) in an expression is not simply a number. It is a minus operator
(which may be prefix minus if no term is to the left of it) followed by a positive number. The result
of the operation is a number.
A whole number is a number that has a zero (or no) decimal part and that the language
processor would not usually express in exponential notation. That is, it has no more digits before
the decimal point than the current setting of NUMERIC DIGITS (the default is 9).
Implementation maximum: The exponent of a number expressed in exponential notation can
have up to nine digits.
Operator Characters:
The characters: +-\/%*|&=¬><and the sequences >= <= \> \< \= ><
<> == \== // && || ** ¬> ¬< ¬= ¬== >> << >>= \<< ¬<< \>> ¬>> <<= /= /==
indicate operations (see page 115). A few of these are also used in parsing templates, and the
equal sign is also used to indicate assignment. Blanks adjacent to operator characters are
removed. Therefore, the following are identical in meaning:
REXX General Concepts
Chapter 12. REXX General Concepts 113