A literal string with no characters (that is, a string of length 0) is called a null string.
'Fred'
"Don't Panic!"
'You shouldn''t' /* Same as "You shouldn't" */
'' /* The null string */
Note that a string followed immediately by a ( is considered to be the name of a function. If followed immediately by the symbol X or x, it is considered to be a hexadecimal string. If followed immediately by the symbol B or b, it is considered to be a binary string. Descriptions of these forms follow. Implementation maximum:A literal string can contain up to 250 characters. But note that the length of computed results is limited only by the amount of storage available. See the note in REXX General Concepts for more information.
'ABCD'x
"1d ec f8"X
"1 d8"x
Implementation maximum: The packed length of a hexadecimal string (the string with blanks removed) cannot exceed 250 bytes.
A binary string is a literal string formed by packing the binary digits given. If the number of binary digits is not a multiple of eight, leading zeros are added on the left to make a multiple of eight before packing. Binary strings allow you to specify characters explicitly, bit by bit.
'11110000'b /* == 'f0'x */
"101 1101"b /* == '5d'x */
'1'b /* == '00000001'b and '01'x */
'10000 10101010'b /* == '0001 0000 1010 1010'b */
''b /* == '' */
Implementation maximum: The packed length of a hexadecimal string (the string with blanks removed) cannot exceed 250 bytes.
Fred
Albert.Hall
WHERE?
<.H.E.L.L.O> /* This is DBCS */
For information about Double-Byte Character Set (DBCS) characters, see Double-Byte Character Set (DBCS) Support.
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.
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 in REXX General Concepts for more information.
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.
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.
345>=123
345 >=123
345 >= 123
345 > = 123
Some of these characters may not be available in all character sets, and, if this is the case, appropriate translations may be used. In particular, the vertical bar (|) or character is often shown as a split vertical bar.
Throughout the language, the not character, ¬, is synonymous with the backslash (\). You can use the two characters interchangeably according to availability and personal preference.
, ; : ) (
These characters constitute the set of special characters. They
all act as token delimiters, and blanks adjacent to any of these are
removed. There is an exception: a blank adjacent to the outside of
a parenthesis is deleted only if it is also adjacent to another special
character (unless the character is a parenthesis and the blank is
outside it, too). For example, the language processor does not remove
the blank in A (Z). This is a concatenation that
is not equivalent to A(Z), a function call. The language
processor does remove the blanks in (A) + (Z) because
this is equivalent to (A)+(Z). 'REPEAT' A + 3;
This is composed
of six tokens—a literal string ('REPEAT'), a blank
operator, a symbol (A, which may have a value), an
operator (+), a second symbol (3, which is a number and a symbol), and the clause delimiter (;). The blanks between the A and the + and between the + and the 3 are removed. However, one of the blanks between the 'REPEAT' and the A remains as an operator. Thus, this clause
is treated as though written: 'REPEAT' A+3;