EXEC-initiated REXX EXECs
An EXEC–initiated EXEC is scheduled when the IMFEXEC SELECT command is coded, specifying the EXEC parameter.
The EXEC parameter names the EXEC to be scheduled along with any parameters; for example
where execname is the name of any EXEC to be scheduled.
Potential use
Use an EXEC-initiated EXEC when you want to
- schedule a common EXEC that might be used by several other EXECs
- schedule another EXEC and have it execute asynchronously
EXEC-initiated EXECs can be scheduled to execute either synchronously or asynchronously by the calling EXEC. For more information, see Invoking-EXECs-synchronously-with-IMFEXEC-SELECT-EXEC-WAIT-YES.
Parameters passed to the EXEC
The first positional parameter is the one- to eight-character name of the EXEC.
Any following positional parameter are optional.
Example of Input
The command
schedules the EXEC called START for execution. An optional parameter containing the value BS4000 is passed to START as input.
Example
This example shows the calling EXEC that schedules the called EXEC named START:
/*----------------------------------------------------------------*/
/* DOC GROUP(MVS) FUNC(VTAM) CODE(VT) */
/* DOC DISP(YES) AUTHOR(B&B) */
/* DOC DESC(CALL ACTIVATE EXEC) */
/*----------------------------------------------------------------*/
'IMFEXEC SELECT EXEC(START BS4000)'
EXIT
MANAGER INITIALIZATION DONE')
In this example, the extra right parenthesis might interfere with parsing of the parameter list causing you to receive unexpected results.
Figure 1 shows the called EXEC:
Figure 1. EXEC-initiated REXX EXEC example
/*----------------------------------------------------------------*/
/* DOC GROUP(MVS) FUNC(VTAM) CODE(VT) */
/* DOC DISP(YES) AUTHOR(B&B) */
/* DOC DESC(CALL ACTIVATE EXEC) */
/*----------------------------------------------------------------*/
'IMFEXEC SELECT EXEC(START BS4000)'
EXIT
The positional parameters passed to the EXEC-initiated EXEC are shown in the following table:
Positional parameter | Variable name | Variable passed | Description of variable passed |
---|---|---|---|
1 | START | START | name of the EXEC |
2 | TERMID | BS4000 | name of the terminal to be started online |
3 | . | . | period pads the positional parameters |
Describing the example
The called EXEC in this example receives a parameter from the calling EXEC (BS4000) and uses that value to vary a VTAM node active with the IMFEXEC CMD command.
Refer to CMD-Type-MVS-Issue-MVS-command-with-response for more information about the IMFEXEC CMD statement and MVS commands.