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


The IRXEXEC routine

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

Use the IRXEXEC routine to run an exec in any MVS™ address space.

Tip: To permit FORTRAN programs to call IRXEXEC, TSO/E provides an alternate entry point for the IRXEXEC routine. The alternate entry point name is IRXEX.

Most users do not need to use IRXEXEC. In TSO/E, you can invoke execs implicitly or explicitly using the TSO/E EXEC command. You can also run execs in TSO/E background. If you want to invoke an exec from a program that is written in a high-level programming language, you can use the TSO service facility to invoke the EXEC command. You can run an exec in MVS batch using JCL and the IRXJCL routine.

You can also call the IRXJCL routine from a REXX exec or a program that is running in any address space to invoke an exec. However, the IRXEXEC routine gives you more flexibility. For example, you can preload the REXX exec in storage and pass the address of the preloaded exec to IRXEXEC. This is useful if you want to run an exec multiple times to avoid the exec being loaded and freed whenever it is invoked. You may also want to use your own load routine to load and free the exec.

If you use the TSO/E EXEC command, you can pass only one argument to the exec. The argument can consist of several tokens. Similarly, if you call IRXJCL from an exec or program, you can only pass one argument. By using IRXEXEC, you can pass multiple arguments to the exec and each argument can consist of multiple tokens. If you pass multiple arguments, you must not set bit 0 (the command bit) in parameter 3.

Note: Use the EXEC command to invoke a REXX exec that uses ISPF services. The EXEC command allows ISPF variables to be resolved. There are cases where a REXX exec invoked using the programming routines IRXJCL and IRXEXEC does not have access to ISPF variables. For more information about ISPF variables, see z/OS ISPF Services Guide.

A program can access IRXEXEC using either the CALL or LINK macro instructions, specifying IRXEXEC as the entry point name. You can obtain the address of the IRXEXEC routine from the REXX vector of external entry points. Format of the REXX vector of external entry points describes the vector.

If you use IRXEXEC, one parameter on the call is the user field. You can use this field for your own processing.

Environment Customization Considerations: If you use the IRXINIT initialization routine to initialize language processor environments, the following information provides several considerations about calling IRXEXEC.

When you call IRXEXEC, you can specify the environment in which you want IRXEXEC to run. On the call to IRXEXEC, you can optionally specify the address of the environment block for the environment in one of the following:
  • the ECTENVBK field of the ECT. The ECT address is in the command processor parameter list (CPPL). Parameter 5 of the IRXEXEC routine specifies the address of the CPPL. For more information about the address of the CPPL, see the description of parameter 5 in Table 1.
  • the parameter list
  • register 0.

If you do not pass an environment block address or IRXEXEC determines the address is not valid, IRXEXEC locates the current environment and runs in that environment. Chains of environments and how environments are located describes how environments are located. If a current environment does not exist or the current environment was initialized on a different task and the TSOFL flag is off in that environment, a new language processor environment is initialized. The exec runs in the new environment. Before IRXEXEC returns, the language processor environment that was created is terminated. Otherwise, it runs in the located current environment.

For more information about specifying environments and how routines determine the environment in which to run, see Specifying the address of the environment block.

Go to the previous page Go to the next page




Copyright IBM Corporation 1990, 2014