Variables, Constants, and Literal Strings

Comprehensive rules for variables, constants, and literal strings are contained in the Open Object Rexx: Reference.

Rexx imposes few rules on variable names. A variable name can be up to 250 characters long, with the following restrictions:

The variable name can be typed and queried in uppercase, mixed-case, or lowercase characters. A variable name in uppercase characters, for example, can also be queried in lowercase or mixed-case characters. Rexx translates lowercase letters in variables to uppercase before using them. Thus the variables names "abc", "Abc", and "ABC" all refer to the single variable "ABC". If you reference a variable name that has not yet been set, the name, in uppercase, is returned.

Literal strings in Rexx are delimited by quotation marks (either ' or "). Examples of literal strings are:

"Final result:"

If you need to use quotation marks within a literal string, use quotation marks of the other type to delimit the string. For example:

"Don't panic"
'He said, "Bother"'

There is another way to do this. Within a literal string, a pair of quotation marks of the same type that starts the string is interpreted as a single character of that type. For example:

'Don''t panic'                 (same as "Don't panic"      )
"He said, ""Bother"""          (same as 'He said, "Bother"')