Function packages are basically several external functions and
subroutines that are grouped or packaged together. When the language processor processes
a function call or a call to a subroutine, the language processor searches
the function packages before searching load libraries or exec libraries,
such as SYSEXEC and SYSPROC. Grouping frequently used external functions
and subroutines in a function package allows for faster access to
the function and subroutine, and therefore, better performance. Search order describes the complete search
order the language processor uses
to locate a function or subroutine.
TSO/E supports three types of function packages. Basically, there
are no differences between the three types, although the intent of
the design is as follows:
- User
packages, which are function packages that an individual user may
write to replace or supplement certain system-provided functions.
When the function packages are searched, the user packages are searched
before the local and system packages.
- Local packages, which are function packages that a system support
group or application group may write. Local packages may contain
functions and subroutines that are available to a specific group of
users or to the entire installation. Local packages are searched
after the user packages and before the system packages.
- System packages, which are function packages that an installation
may write for system-wide use or for use in a particular language processor environment. System
packages are searched after any user and local packages.
To provide function packages, there are several steps you must
perform:
- You must first write the individual external functions and subroutines
you want to include in a function package. If you want to include
an external function or subroutine in a function package, the function
or subroutine must be link-edited into a load module. If you write
the function or subroutine in REXX and the REXX exec is interpreted
(that is, the TSO/E REXX interpreter executes the exec), you cannot
include the function or subroutine in a function package. However,
if you write the external function or subroutine in REXX and the REXX
exec is compiled, you can include the function or subroutine in a
function package because the compiled exec can be link-edited into
a load module. For information about compiled execs, see the appropriate
compiler publications.
If you write the external function or subroutine
in a programming language other than REXX, the language you use must
support the system-dependent interfaces that the language processor uses to
invoke the function or subroutine. Interface for writing external function and subroutine code describes
the interfaces.
- After you write the individual functions and subroutines, you
must write the directory for the function package. You need a directory
for each individual function package.
The function package directory
is contained in a load module. The directory contains a header followed
by individual entries that define the names and/or the addresses of
the entry points of your function or subroutine code. Directory for function packages describes the directory for function
packages.
- The name of the entry point at the beginning of the directory
(the function package name) must be specified in the function package
table for a language processor environment.
Function package table describes the format of
the table. After you write the directory, you must define the directory
name in the function package table. There are several ways you can
do this depending on the type of function package you are defining
(user, local, or system) and whether you are providing only one or
several user and local function packages.
If you are providing
a local or user function package, you can name the function package
directory IRXFLOC (local package) or
IRXFUSER (user package). TSO/E provides these two "dummy" directory
names in the three default parameters modules IRXPARMS, IRXTSPRM,
and IRXISPRM. By naming your local function package directory IRXFLOC
and your user function package directory IRXFUSER, the external functions
and subroutines in the packages are automatically available to REXX
execs that run in non-TSO/E and the TSO/E address space.
If
you write your own system function package or more than one local
or user function package, you must provide a function package table
containing the name of your directory. You must also provide your
own parameters module that points to your function package table.
Your parameters module then replaces the default parameters module
that the system uses to initialize a default language processor environment. Specifying directory names in the function package table describes how to define directory
names in the function package table.
Note: If you explicitly call the IRXINIT routine, you can pass the
address of a function package table containing your directory names
on the call.
TSO/E provides the IRXEFMVS and IRXEFPCK system function packages.
The two function packages provide the TSO/E
external functions, which are described in TSO/E external functions. The IRXEFMVS and IRXEFPCK system
function packages are defined in the default parameters modules TSO/E
provides (see Values provided in the three default parameters modules).
Other IBM® products may also provide
system function packages that you can use for REXX processing in TSO/E
and MVS™. If you install a product
that provides a system function package for TSO/E REXX, you must change
the function package table and provide your own parameters modules.
The product itself supplies the individual functions in the function
package and the directory for their function package. To use the
functions, you must do the following:
- Change the function package table. The function package table
contains information about the user, local, and system function packages
for a particular language processor environment. Table 1 shows the format of the
table. Add the name of the function package directory to the entries
in the table. You must also change the SYSTEM_TOTAL and SYSTEM_USED
fields in the table header (offsets +28 and +32). Increment the value
in each field by 1 to indicate the additional function package supplied
by the IBM product.
- Provide your own IRXTSPRM, IRXISPRM, or IRXPARMS parameters module.
The function package table is part of the parameters module that the
system uses to initialize language processor environments. You
need to code one or more parameters modules depending on whether you
want the function package available to REXX execs that run in ISPF
only, TSO/E only, TSO/E and ISPF, non-TSO/E only, or any address space.
Language Processor Environments describes environments,
their characteristics, and the format of the parameters modules.
In the same chapter, Changing the default values for initializing an environment describes
how to provide your own parameters modules.