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


Using the CONSOLE Host command environment

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

TSO/E provides the CONSOLE host command environment that lets you issue MVS™ system and subsystem commands from a REXX exec. Using the CONSOLE environment eliminates the need for you to repeatedly use the TSO/E CONSOLE command with the SYSCMD keyword to issue MVS commands. With ADDRESS CONSOLE, you need only enter the name of the command.

You can use ADDRESS CONSOLE to issue a single MVS system or subsystem command, for example:
ADDRESS CONSOLE "system_command"
You can also use ADDRESS CONSOLE and then issue several MVS system or subsystem commands from the CONSOLE host command environment, for example:
/*  REXX program ...    */
⋮
"CONSOLE ACTIVATE"
⋮
ADDRESS CONSOLE
"mvs_cmd1"
⋮
"mvs_cmd2"
⋮
"mvs_cmd3"
⋮
EXIT
If you have established CONSOLE as the host command environment and you want to enter TSO/E commands, use the ADDRESS TSO instruction to change the host command environment to TSO. The following example shows how to use the ADDRESS instruction to change between the TSO and CONSOLE host command environments.
/*  REXX program  ... */
⋮
"tso_cmd"            /* initial environment is TSO                       */
"CONSOLE ACTIVATE"
⋮
ADDRESS CONSOLE      /* change environment to CONSOLE for all commands   */
"mvs_cmd"
⋮
"mvs_cmd"
ADDRESS TSO tso_cmd      /* change environment to TSO for one command    */
⋮
"mvs_cmd"
⋮
ADDRESS TSO              /* change environment to TSO for all commands   */
"tso_cmd"
⋮
ADDRESS CONSOLE mvs_cmd /* change environment to CONSOLE for one command */
⋮
"tso_cmd"
⋮
"CONSOLE DEACTIVATE"
⋮
EXIT

For more information about using the ADDRESS keyword instruction, see ADDRESS.

To use the CONSOLE host command environment, you must have CONSOLE command authority. You must also activate a console session before using ADDRESS CONSOLE. If you use ADDRESS CONSOLE and issue an MVS command before you activate a console session, the CONSOLE environment will not be able to locate the command you issued. In this case, the REXX special variable RC is set to -3 and the FAILURE condition occurs. The -3 return code indicates that the host command environment could not locate the command. In this case, the environment could not locate the command because a console session is not active.

The MVS system and subsystem commands you can use during a console session depend on the MVS command authority defined for the user console. For more information, see z/OS MVS Planning: Operations.

Go to the previous page Go to the next page




Copyright IBM Corporation 1990, 2014