Storing and Accessing an External Function

In this section:

Internal functions are built in and do not require additional work to access. External functions are stored in load libraries from which they must be retrieved. The way these external functions are accessed is determined by your platform. These techniques may not have to be used every time a function is accessed. Access to a load library may be set only once at the time of installation.

You can also access private user-written subroutines. If you have a private collection of subroutines (that is, you created your own or use customized subroutines), do not store them in the function library. Store them separately to avoid overwriting them whenever your site installs a new release. For more information on creating a subroutine, see Creating a Subroutine.

Storing and Accessing a Function on z/OS

How to:

On z/OS, load libraries are partitioned data sets containing link-edited modules. These libraries are stored as EDALIB.LOAD or FUSELIB.LOAD. In addition, your site may have private subroutine collections stored in separate load libraries. If so, you must allocate those libraries.

Procedure: How to Allocate a Load Library in z/OS Batch

To use a function stored as a load library, allocate the load library to ddname USERLIB in your JCL or CLIST.

The search order is USERLIB, STEPLIB, JOBLIB, link pack area, and linklist.

The Server also adds the TASKLIB keyword to the search for non-APF authorized libraries. For more information, see the Server Installation, Configuration and Operations for MVS manual.

Example: Allocating the Load Library BIGLIB.LOAD in z/OS Batch (JCL)

//USERLIB DD DISP=SHR,DSN=BIGLIB.LOAD

Syntax: How to Allocate a Load Library

DYNAM ALLOC FILE USERLIB DA lib SHR

where:

USERLIB

Is the ddname to which you allocate a load library.

lib1 lib2 lib3...

Are the names of the load libraries, concatenated to ddname USERLIB.

Example: Allocating the FUSELIB.LOAD Load Library

DYNAM ALLOC FILE USERLIB DA MVS.FUSELIB.LOAD SHR 

Example: Concatenating a Load Library to USERLIB In TSO

Suppose a report request calls two functions: BENEFIT stored in library SUBLIB.LOAD, and EXCHANGE stored in library BIGLIB.LOAD. To concatenate the BIGLIB and SUBLIB load libraries in the allocation for ddname USERLIB, issue the following commands:

DYNAM ALLOC FILE USERLIB DA SUBLIB.LOAD SHR
DYNAM ALLOC FILE BIGLIB  DA BIGLIB.LOAD SHR
DYNAM CONCAT FILE USERLIB BIGLIB 

The load libraries are searched in the order in which they are specified in the ALLOCATE command.

Example: Concatenating a Load Library to STEPLIB in Batch (JCL)

Concatenate the load library to the ddname STEPLIB in your JCL:

//FOCUS EXEC PGM=FOCUS
//STEPLIB     DD DSN=FOCUS.FOCLIB.LOAD,DISP=SHR
//            DD DSN=FOCUS.FUSELIB.LOAD,DISP=SHR
                           .
                           .
                           .

Storing and Accessing a Function on UNIX

No extra work is required.

Storing and Accessing a Function on Windows

No extra work is required.