Start REXX Procedure (STRREXPRC)
The Start REXX Procedure (STRREXPRC) command calls the interpreter, explicitly specifying the library, file, and source member to interpret.
Keyword |
Description |
Choices |
Notes |
SRCMBR |
Source member |
Name |
Required, Positional 1 |
SRCFILE |
Source file |
Qualified object name |
Optional |
Qualifier 1: Source file |
Name, QREXSRC |
Qualifier 2: Library |
Name, *LIBL, *CURLIB |
PARM |
Parameters |
Character value, *NONE |
Optional |
CMDENV |
Command environment |
Single values: *COMMAND, *CPICOMM, *EXECSQL Other values: Qualified object name |
Optional |
Qualifier 1: Command environment |
Name |
Qualifier 2: Library |
Name, *LIBL, *CURLIB |
EXITPGM |
Exit program |
Single values: *NONE Other values (up to 8 repetitions): Element list |
Optional |
Element 1: Program |
Qualified object name |
Qualifier 1: Program |
Name |
Qualifier 2: Library |
Name, *LIBL, *CURLIB |
Element 2: Exit code |
2, 3, 4, 5, 7, 8, 9, 10 |
Source member (SRCMBR)
Specifies the name of the source file member that contains the REXX procedure to be started.
This is a required parameter.
Source file (SRCFILE)
Specifies the source file that contains the REXX procedure to be started.
The possible source file values are:
- QREXSRC
- The IBM-supplied source file, QREXSRC, contains the REXX procedure.
- source-file-name
- Specify the name of the source file that contains the REXX procedure to be run.
The possible library values are:
- *LIBL
- The library list is used to locate the program.
- *CURLIB
- The current library is used to locate the program. If no library is specified as the current library for the job, QGPL is used.
- library-name
- Specify the library name.
Parameters (PARM)
Specifies procedure parameter values passed to the REXX procedure when it is started. These values are accessed through the argument (ARG) instruction within the REXX procedure.
The possible values are:
- *NONE
- There are no procedure parameters for the REXX procedure. The ARG instruction returns a null string.
- procedure-parameters
- Specify the procedure parameter value to pass to the REXX procedure. A maximum of 3000 characters is allowed.
Command environment (CMDENV)
Specifies the initial command environment program to process commands embedded in the REXX procedure. The REXX interpreter will call this environment whenever a command is encountered within the REXX procedure.
The possible values are:
- *COMMAND
- The AS/400 control language (CL) command environment is used.
- *CPICOMM
- The Common Programming Interface (CPI) for Communications command environment is used.
- *EXECSQL
- The Structured Query Language (SQL) Command environment is used. EXECSQL is the command environment used for CL commands that are imbedded within a REXX procedure.
- program-name
- Specify the name of the program to process commands embedded in the REXX procedure.
The possible library values are:
- *LIBL
- The library list is used to locate the program.
- *CURLIB
- The current library for the job is used to locate the program. If no library is specified as the current library for the job, QGPL is used.
- library-name
- Specify the name of the library where the program is located.
Exit program (EXITPGM)
Specifies exit programs to be used when the interpreter is called. A maximum of 8 program and exit code pairs can be specified.
Note: If multiple system exit codes are specified, the last one specified is the one taken.
The possible values are:
- *NONE
- There are no exit programs for this call.
- program-name
- Specify a program name. A maximum of 8 program names can be specified.
The possible library values are:
- *LIBL
- The library list is used to locate the programs.
- *CURLIB
- The current library for the job is used to locate the programs. If no library is specified as the current library for the job, QGPL is used.
- library-name
- Specify the name of the library where the programs are located.
- exit-code
- Specify an exit code. A maximum of 8 exit codes can be specified.
- Exit-code
- Description
- 2
- The associated program is called whenever an external function or subroutine has been called by the REXX program. The exit program is then responsible for locating and calling the requested routine.
- 3
- The associated program is called whenever the interpreter is going to call a command. The exit program is responsible for locating and calling the command given the command string and the current environment name.
- 4
- The associated program is called whenever a REXX instruction or function attempts an operation on the REXX external data queue.
- 5
- The associated program is called when session input or output operations are attempted.
- 7
- The associated program is called after running each clause of the REXX procedure to determine whether it should be stopped.
- 8
- The associated program is called after running each clause of the REXX program to check if tracing should be turned on or off.
- 9
- The associated program is called before interpretation of the first instruction of a REXX procedure (including REXX procedures called as external functions and subroutines).
- 10
- The associated program is called after interpretation of the last instruction of a REXX procedure (including REXX procedures called as external functions and subroutines).
STRREXPRC SRCMBR(ABC)
This command calls the REXX interpreter instructing it to run the source member named ABC in the first QREXSRC source file in the library list (*LIBL).
*ESCAPE Messages
- CPF7CFB
- Error occurred while processing REXX exit programs.
- CPF7CFD
- Error occurred running REXX procedure &1.
- CPF7CFF
- REXX procedure &1 ended; return code &4.
- CPF7CF2
- REXX procedure &1 not found.
- CPF7CF3
- Not authorized to source file &2.
- CPF7CF4
- Cannot allocate REXX procedure &1.
- CPF7CF6
- Cannot allocate REXX source file &2.
- CPF7CF7
- REXX external data queue is damaged.