Letter case of REXX instructions
You can enter a REXX instruction in lowercase, uppercase, or mixed case. The language processor translates alphabetic characters to uppercase, unless you enclose them in single or double quotation marks.
For example, SAY
, Say
, and say
all have the
same meaning.
Using quotation marks in an instruction
SAY 'This is a REXX literal string.' /* Using single quotation marks */
SAY "This is a REXX literal string." /* Using double quotation marks */
SAY 'This is a REXX literal string." /* Using mismatched quotation marks */
SAY This is a REXX string.
results in:
THIS IS A REXX STRING.
(This assumes none of the words is the name of a
variable that you have already assigned a value. In REXX, the default value of a variable is its own
name in uppercase.) SAY "This isn't difficult!"
SAY 'This isn''t difficult!'
This isn't difficult!
Ending an instruction
A line usually contains one instruction, except when it contains a semicolon (;) or ends with a comma (,).
SAY 'Hi!'; say 'Hi again!'; say 'Hi for the last time!'
Hi!
Hi again!
Hi for the last time!
Continuing an instruction
SAY 'This is an extended',
'REXX literal string.'
The comma at the end
of the first line adds a space (between extended
and REXX
) when
the two lines are concatenated for output. A single line results:
This is an extended REXX literal string.
SAY 'This is',
'a string.'
SAY 'This is' 'a string.'
The space between the two separate strings is
preserved: This is a string.
Continuing a literal string without adding a space
SAY 'This is an extended literal string that is bro'||,
'ken in an awkward place.'
This example results in one line and no space in the word broken:
This is an extended literal string that is broken in an
awkward place.
SAY 'This is' ||,
'a string.'
SAY 'This is' || 'a string.'
These examples
result in: This isa string.
In both examples, the concatenation operator deletes spaces between the two strings.
This is a REXX literal string.
This is a REXX literal string.
This is a REXX literal string.
This is a REXX literal string.
This is a REXX literal string.
This is a REXX literal string.
This is a REXX literal string.
You can begin an instruction anywhere on a line, you can insert blank lines, and you can insert extra spaces between words in an instruction. The language processor ignores blank lines, and it ignores spaces that are greater than one. This flexibility of format lets you insert blank lines and spaces to make programs easier to read.
Blanks and spaces are only significant during parsing. See Parsing data.