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

A series of characters within matching quotation marks is a literal string . The following examples contain literal strings.
SAY 'This is a REXX literal string.' /* Using single quotation marks */

SAY "This is a REXX literal string." /* Using double quotation marks */
Do not enclose a literal string with one each of the two different types of quotation marks. For example, the following is incorrect :
SAY 'This is a REXX literal string." /* Using mismatched quotation marks */
If you omit the quotation marks around a literal string in a SAY instruction, the language processor usually translates the statement to uppercase. For example,
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.)
If a string contains an apostrophe, you can enclose the literal string in double quotation marks.
SAY "This isn't difficult!"
You can also use two single quotation marks in place of the apostrophe, because a pair of single quotation marks is processed as one.
SAY 'This isn''t difficult!'
Either way, the outcome is the same.
This isn't difficult!

Ending an instruction

A line usually contains one instruction, except when it contains a semicolon (;) or ends with a comma (,).

The end of the line or a semicolon indicates the end of an instruction. If you put one instruction on a line, the end of the line delineates the end of the instruction. If you put multiple instructions on one line, you must separate adjacent instructions with a semicolon.
SAY 'Hi!'; say 'Hi again!'; say 'Hi for the last time!'
This example would result in three lines.
Hi!
Hi again!
Hi for the last time!

Continuing an instruction

A comma is the continuation character. It indicates that the instruction continues to the next line. The comma, when used in this manner, also adds a space when the lines are concatenated. Here is how the comma continuation character works when a literal string is being continued on the next line.
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.
The following two instructions are identical and yield the same result:
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

If you need to continue an instruction to a second or more lines, but do not want REXX to add spaces in the line, use the concatenation operand (two single OR bars, ||).
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.
Also note that the following two instructions are identical and yield the same result:
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.

The following example demonstrates the free format of REXX.
Figure 1. Example of free format
/************************* REXX *****************************/
SAY 'This is a REXX literal string.'
SAY           'This is a REXX literal string.'
   SAY 'This is a REXX literal string.'
SAY,
'This',
'is',
'a',
'REXX',
'literal',
'string.'

SAY'This is a REXX literal string.';SAY'This is a REXX literal string.'
SAY '     This is a REXX literal string.'
Running this example results in six lines of identical output, followed by one indented line.
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.