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.
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.
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.
//USERLIB DD DISP=SHR,DSN=BIGLIB.LOAD
Allocate the load library to ddname USERLIB using the ALLOCATE command. You can issue the ALLOCATE command:
If you are in a FOCUS session, you can also use the DYNAM ALLOCATE command.
If you are in a FOCUS session, you can also use the DYNAM ALLOCATE command.
{MVS|TSO} ALLOCATE FILE(USERLIB) DSN(lib1 lib2 lib3 ...) SHR
or
DYNAM ALLOC FILE USERLIB DA lib SHR
where:
Is the prefix if you issue the ALLOCATE command from your application or include it in your PROFILE FOCEXEC.
Is the ddname to which you allocate a load library.
Are the names of the load libraries, concatenated to ddname USERLIB.
TSO ALLOC FILE(USERLIB) DSN('MVS.FUSELIB.LOAD') SHR
or
DYNAM ALLOC FILE USERLIB DA MVS.FUSELIB.LOAD SHR
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.
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 . . .
In this section: Reference: |
On VM/CMS, supplied functions are stored as one of the following:
EXCHANGE TEXT
In addition to the preceding libraries and files, your site may have private collections of subroutines stored in separate libraries or text files.
The standard VM/CMS search sequence applies to functions:
To search for a function stored in a load or text library, issue the CMS GLOBAL command. You can issue the GLOBAL command:
You must also specify a system library for a function written in a language such as COBOL or PL/I, and for a function that calls a system function. FUSELIB functions do not require any other system libraries.
If you issue two GLOBAL commands of the same type, the second command replaces the first. Once a library is opened (as a result of referencing one of its members), the library cannot be changed until you exit.
If you have a private subroutine collection, specify the function library or libraries in the GLOBAL command in addition to the FUSELIB library.
Note: FUSELIB functions now reside in FUSELIB LOADLIB (rather than in a TXTLIB). Issuing GLOBAL TXTLIB FUSELIB still works because the TXTLIB still exists. However, VM/CMS loads supplied functions from the LOADLIB before searching the TXTLIB.
CMS GLOBAL {LOADLIB|TXTLIB} library1 library2 library3 ...
where:
Is required if you issue the GLOBAL command from a procedure.
Indicates the library is a load library.
Indicates the library is a text library.
Are the names of the libraries containing the functions. The maximum number of libraries is 63.
CMS QUERY {LOADLIB|TXTLIB}
where:
Indicates the library is a load library.
Indicates the library is a text library.
The following command, issued in the global profile, accesses the FUSELIB load library:
CMS GLOBAL LOADLIB FUSELIB
The following command, issued in a procedure, accesses the SUBLIB and BIGLIB libraries:
CMS GLOBAL TXTLIB SUBLIB BIGLIB
The GLOBAL library list automatically contains the FUSELIB function library. To add or delete private subroutine libraries, use two CMS EXECs, FOCADLIB or FOCDELIB.
Before you add LOADLIBs to the GLOBAL library list, the existing list is saved. Then the required and optional LOADLIBs are added in front of any libraries you may have specified. After a request, the prior GLOBAL environment is restored.
Prior entries can be retained in the GLOBAL library list and new entries added by using the FOCADLIB EXEC. To delete entries while maintaining others in the list, use the FOCDELIB EXEC. For both FOCADLIB and FOCDELIB, the output from the EXEC is the return code of the GLOBAL command. FOCADLIB and FOCDELIB must be found in the VM/CMS search sequence (A–Z).
CMS EX {FOCADLIB|FOCDELIB} libtype lib1 [lib2 lib3...] [(QUIET ]
where:
Adds libraries to the beginning of the GLOBAL library list.
Deletes libraries from the GLOBAL library list.
Is the library type, for example, LOADLIB or TXTLIB.
Are the names of the libraries to be added or deleted.
Suppresses messages from the GLOBAL command. The open parenthesis is required.
Information Builders |