RFS This is an optional environment that executes commands for the REXX File System.
RLS This is an optional environment that executes commands for the REXX List System.
Note: It is recommended that the default environment of REXXCICS be used for all commands (that is,
the ADDRESS instruction should not be specified).
How Is a Command Passed to the Host Environment?
The language processor evaluates each expression in a REXX program. This evaluation results in a
character string (which may be the null string). The character string is prepared appropriately and
submitted to the host command environment. The environment processes the string as a command, and,
after processing is complete, returns control to the language processor. If the string is not a valid
command for the current host command environment, a failure occurs and the special variable RC
contains the return code from the host command environment.
Changing the Host Command Environment
You can change the host command environment either from the default environment (REXXCICS) or from
whatever environment was previously established. To change the host command environment, use the
ADDRESS instruction followed by the name of an environment.
The ADDRESS instruction has two forms; one affects only a single command, and one affects all
commands issued after the instruction.
v Single command
When an ADDRESS instruction includes both the name of the host command environment and a
command, only that command is sent to the specified environment. After the command is complete the
former host command environment becomes active again.
v All commands
When an ADDRESS instruction includes only the name of the host command environment, all
commands issued afterward within that program are processed as that environment's commands.
This ADDRESS instruction affects only the host command environment of the program that uses the
instruction. If a program calls an external routine, the host command environment is the default
environment regardless of the host command environment of the calling program. Upon return to the
original program, the host command environment that the ADDRESS instruction previously established
is resumed.
Determining the Active Host Command Environment
To find out which host command environment is currently active, use the ADDRESS built-in function.
Example
curenv = ADDRESS()
In this example, curenv is set to the active host command environment, for example, REXXCICS.
Using Commands from a Program
Chapter 8. Using Commands from a program 83