
Invoking Another Exec with the EXEC Command
To explicitly invoke another exec from within an exec, issue the EXEC command as
you would any other TSO/E command. The called exec should end with a RETURN
or EXIT instruction, ensuring that control returns to the caller. The REXX special
variable RC is set to the return code from the EXEC command. You can optionally
return a value to the caller on the RETURN or EXIT instruction. When control
passes back to the caller, the REXX special variable RC is set to the value of the
expression returned on the RETURN or EXIT instruction.
For example, to invoke an exec named MYREXX.EXEC(CALC) and pass it an
argument of four numbers, you could include the following instructions:
"EXEC myrexx.exec(calc) '24 55 12 38' exec"
SAY 'The result is' RC
'Calc' might contain the following instructions:
ARG number1 number2 number3 number4
answer = number1 * (n number3) - number4
RETURN answer
You might want to invoke an exec with the EXEC command rather than as an
external routine when the exec is not within the same PDS as the calling exec, or
when the PDSs of the two execs are not allocated to either SYSEXEC or
SYSPROC.
Invoking Another Exec Implicitly
To implicitly invoke another exec from within an exec, type the member name either
with or without %. Because it is treated as a command, enclose the member name
and the argument, if any, within quotation marks. As with any other implicitly
invoked exec, the PDSs containing the calling exec and the called exec must be
allocated to either SYSEXEC or SYSPROC. Remember that a % before the
member name reduces the search time because fewer files are searched.
For example, to implicitly invoke an exec named MYREXX.EXEC(CALC) and send
it an argument of four numbers, you could include the following instructions.
"%calc 24 55 12 38"
SAY 'The result is' RC
'Calc' might contain the following instructions:
ARG number1 number2 number3 number4
answer = number1 * (n number3) - number4
RETURN answer
Issuing Other Types of Commands from an Exec
A REXX exec in TSO/E can issue TSO/E commands, APPC/MVS calls, MVS
module invocations, ISPF commands, and ISPF/PDF EDIT commands. If you have
TSO/E CONSOLE command authority and an extended MCS console session is
active, you can also issue MVS system and subsystem commands in a REXX exec.
Each type of invocation is associated with a different
host command environment.
What is a Host Command Environment?
An environment for executing commands is called a host command environment.
Before an exec runs, an active host command environment is defined to handle
commands issued by the exec. When the language processor encounters a
command, it passes the command to the host command environment for
processing.
Issuing TSO/E Commands from an Exec
Chapter 8. Entering Commands from an Exec
101
Содержание TSO/E REXX
Страница 1: ...z OS TSO E REXX User s Guide SA22 7791 00 ...
Страница 2: ......
Страница 3: ...z OS TSO E REXX User s Guide SA22 7791 00 ...
Страница 10: ...viii z OS V1R1 0 TSO E REXX User s Guide ...
Страница 12: ...x z OS V1R1 0 TSO E REXX User s Guide ...
Страница 14: ...xii z OS V1R1 0 TSO E REXX User s Guide ...
Страница 18: ...xvi z OS V1R1 0 TSO E REXX User s Guide ...
Страница 20: ...2 z OS V1R1 0 TSO E REXX User s Guide ...
Страница 58: ...Tracing Expressions with the TRACE Instruction 40 z OS V1R1 0 TSO E REXX User s Guide ...
Страница 78: ...60 z OS V1R1 0 TSO E REXX User s Guide ...
Страница 86: ...Built In Functions 68 z OS V1R1 0 TSO E REXX User s Guide ...
Страница 128: ...Issuing Other Types of Commands from an Exec 110 z OS V1R1 0 TSO E REXX User s Guide ...
Страница 136: ...Debugging Execs 118 z OS V1R1 0 TSO E REXX User s Guide ...
Страница 170: ...Protecting Elements in the Data Stack 152 z OS V1R1 0 TSO E REXX User s Guide ...
Страница 201: ...Part 3 Appendixes Copyright IBM Corp 1988 2001 183 ...
Страница 202: ...184 z OS V1R1 0 TSO E REXX User s Guide ...
Страница 222: ...Using Variables 204 z OS V1R1 0 TSO E REXX User s Guide ...
Страница 226: ...208 z OS V1R1 0 TSO E REXX User s Guide ...
Страница 238: ...220 z OS V1R1 0 TSO E REXX User s Guide ...
Страница 241: ......