STRREXPRC (Start REXX Procedure)

STRREXPRC Command syntax diagram

 

Purpose

The Start REXX Procedure (STRREXPRC) command calls the REXX interpreter to start a REXX procedure that resides in the specified source member.

 

Required Parameters

SRCMBR
Specifies the name of the source file member that contains the REXX procedure to be started.

 

Optional Parameters

SRCFILE
Specifies the source file containing the REXX procedure to be started.

The name of the source file can be qualified by one of the following library values:

*LIBL: All libraries in the job's library list are searched until the first match is found.

*CURLIB: The current library for the job is searched. If no library is specified as the current library for the job, the QGPL library is used.

library-name: Specify the name of the library to be searched.

QREXSRC: The IBM-supplied source file QREXSRC contains the REXX procedure to be started.

source-file-name: Specify the name of the source file that contains the REXX procedure to be started.

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.

*NONE: There are no procedure parameters for the REXX procedure. The ARG instruction returns a null string.

procedure-parameter-string: Specify the parameter string to be passed to the REXX procedure. Up to 3000 characters are allowed.

CMDENV
Specifies the initial command environment program name to process commands that are merged within the REXX procedure. The REXX interpreter calls this environment whenever a command is encountered during the REXX procedure.

*COMMAND: The iSeries 400 command environment is used.

*CPICOMM: The Common Programming Interface (CPI) for communications command environment is used. CPICOMM is the command environment used for CL commands that are imbedded within a REXX procedure.

*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.

The name of the program can be qualified by one of the following library values:

*LIBL: All libraries in the job's library list are searched until the first match is found.

*CURLIB: The current library for the job is searched. If no library is specified as the current library for the job, the QGPL library is used.

library-name: Specify the name of the library to be searched.

program-name: Specify the name of the program.

EXITPGM
Specifies exit programs to be used when the interpreter is called. A maximum of 8 exit programs can be specified.

*NONE: There are no exit programs for the interpreter being called.

The name of the program can be qualified by one of the following library values:

*LIBL: All libraries in the job's library list are searched until the first match is found.

*CURLIB: The current library for the job is searched. If no library is specified as the current library for the job, the QGPL library is used.

library-name: Specify the name of the library to be searched.

Element 1: Exit Program

program-name: Specify up to eight program names.

Element 2: Exit Code

exit-code: Specify up to eight exit codes. The valid exit codes that can be specified for this value range from 2 through 5 and 6 through 8.

Exit-code Description

  1. The associated program is called whenever an external function or subroutine is called by the REXX program. The exit program is then responsible for locating and calling the requested routine.
  2. 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.
  3. The associated program is called whenever a REXX instruction or function attempts an operation on the REXX external data queue.
  4. The associated program is called when session input or output operations are attempted.
  5. The associated program is called after running each clause of the REXX procedure to determine whether it is to be halted.
  6. The associated program is called after running each clause of the REXX program to check if tracing is to be turned on or off.
  7. The associated program is called before interpretation of the first instruction of a REXX procedure (including REXX procedures called as external functions and subroutines).
  8. The associated program is called after interpretations of the last instruction of a REXX procedure (including REXX procedures called as external functions and subroutines).

Example for STRREXPRC

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).

Error messages for STRREXPRC

*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.