Compiling and Storing a Subroutine

In this section:

After you write a subroutine, you need to compile and store it. This topic discusses compiling and storing your subroutine for CMS and z/OS.


Top of page

x
Compiling and Storing a Subroutine on CMS

How to:

Reference:

Compile the subroutine, then use the GENSUBLL command to add the compiled object code to a load library (file type LOADLIB). Do not store the subroutine in the FUSELIB load library (FUSELIB LOADLIB), as it may be overwritten when you install the next release of your application. You may also store the compiled object code either as a text file (file type TEXT), or as a member in a text library (file type TXTLIB).



x
Reference: Storing a Subroutine in a Text File or Library

You can store a subroutine in two types of text files, a text file or a text library. Individual text files are easier to maintain and control, but text libraries enable you to build different entry points into the subroutine. For details, see Executing a Subroutine at an Entry Point.

There are two CMS commands for use with a text library:

If the subroutine is written in PL/I, append this line at the end of the text file

ENTRY subroutine 

where:

subroutine

Is the name of the subroutine. You can do this using your system editor.

Make sure that any subroutine that your subroutine calls is also compiled and placed in text file or library.



x
Syntax: How to Query the Location of a Compiled Object
GENSUBLL ?

displays online information about the GENSUBLL command.


Top of page

x
Compiling and Storing a Subroutine on z/OS

Compile the subroutine, then link-edit it and store the module in a load library. If your subroutine calls other subroutines, compile and link-edit all the subroutines together in a single module. Do not store the subroutine in the FUSELIB load library (FUSELIB.LOAD), as it may be overwritten when your site installs the next release of FOCUS.

If the subroutine is written in PL/I, include the following when link-editing the subroutine

ENTRY subroutine

where:

subroutine

Is the name of the subroutine.


Information Builders