Continuing a literal string without adding a space

About this task

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 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.

Thus, 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 a program easier to read.

Blanks and spaces are only significant during parsing, see section Parsing Data.


Task Task

Feedback


Timestamp icon Last updated: Tuesday, 7 January 2014


http://pic.dhe.ibm.com/infocenter/cicsts/v5r1/topic/com.ibm.cics.rexx.doc//dfhrx/dfhrx00013.html