z/OS TSO/E REXX Reference
Previous topic | Next topic | Contents | Contact z/OS | Library | PDF


Keyword instructions

z/OS TSO/E REXX Reference
SA32-0972-00

A keyword instruction is one or more clauses, the first of which starts with a keyword that identifies the instruction. Some keyword instructions affect the flow of control, while others provide services to the programmer. Some keyword instructions, like DO, can include nested instructions.

In the syntax diagrams on the following pages, symbols (words) in capitals denote keywords or subkeywords; other words (such as expression) denote a collection of tokens as defined previously. Note, however, that the keywords and subkeywords are not case-dependent; the symbols if, If, and iF all have the same effect. Note also that you can usually omit most of the clause delimiters (;) shown because they are implied by the end of a line.

A keyword instruction is recognized only if its keyword is the first token in a clause, and if the second token does not start with an = character (implying an assignment) or a colon (implying a label). The keywords ELSE, END, OTHERWISE, THEN, and WHEN are recognized in the same situation. Note that any clause that starts with a keyword defined by REXX cannot be a command. Therefore,
arg(fred) rest
is an ARG keyword instruction, not a command that starts with a call to the ARG built-in function. A syntax error results if the keywords are not in their correct positions in a DO, IF, or SELECT instruction. (The keyword THEN is also recognized in the body of an IF or WHEN clause.) In other contexts, keywords are not reserved and can be used as labels or as the names of variables (although this is generally not suggested).

Certain other keywords, known as subkeywords, are reserved within the clauses of individual instructions. See Keyword instructions. For example, the symbols VALUE and WITH are subkeywords in the ADDRESS and PARSE instructions, respectively. For details, see the description of each instruction. For a general discussion on reserved keywords, see Reserved keywords.

Blanks adjacent to keywords have no effect other than to separate the keyword from the subsequent token. One or more blanks following VALUE are required to separate the expression from the subkeyword in the example following:
ADDRESS VALUE expression
However, no blank is required after the VALUE subkeyword in the following example, although it would add to the readability:
ADDRESS VALUE'ENVIR'||number

Go to the previous page Go to the next page




Copyright IBM Corporation 1990, 2014