ADDRESS temporarily or permanently changes the destination of commands.Commands are strings sent to an external environment.You can send commands by specifying clauses consisting of only an expression or by using the ADDRESS instruction.

To send a single command to a specified environment, code an environment, a literal string or a single symbol, which is taken to be a constant, followed by an expression.(The environment name is the name of an external procedure or process that can process commands.) The expression is evaluated, and the resulting string is routed to the environment to be processed as a command.(Enclose in quotation marks any part of the expression you do not want to be evaluated.) After execution of the command, environment is set back to whatever it was before, thus temporarily changing the destination for a single command.The special variable RC is set, just as it would be for other commands. Errors and failures in commands processed in this way are trapped or traced as usual.

Example:

If you specify only environment, a lasting change of destination occurs: all commands that follow (clauses that are neither REXX instructions nor assignment instructions) are routed to the specified command environment, until the next ADDRESS instruction is processed. The previously selected environment is saved.

Example:

"QBUF"
"MAKEBUF"

Similarly, you can use the VALUE form to make a lasting change to the environment. Here expression1 (which may be simply a variable name) is evaluated, and the result forms the name of the environment. You can omit the subkeyword VALUE if expression1 does not begin with a literal string or symbol (that is, if it starts with a special character, such as an operator character or parenthesis).

Example: