CREATING A LOAD MODULE - IBM Mainframe

The linkage editor processes your compiled program (object module) and readies it for execution. The processed object module becomes a load module. Optionally, the linkage editor can process more than one object module or-load module and transform them into a single load module or into multiple load modules by using the NAME linkage editor statement. Creating a Load Module under MVS

The following sample shows the general job control procedure for creating a load module (link-editing).

CREATING A LOAD MODULE

Creating a Load Module under TSO

To link-edit your program under TSO, use the LINK command. At your terminal, enter the command, followed by the name or names of the object modules you want to link-edit:

  • LINK program2.obj

The load module is placed by default in member TEMPNAME of the userid.program-name.LOAD data set, unless a NAME card was included in the object modules by using the NAME compiler option. If you want to specify another data set for the resulting load module, code your request this way:

  • LINK program-name LOAD(data-set-name(member))

The following example shows how to link-edit two object modules and place the resulting load module in member TEMPNAME of the userid.LM.LOAD data set.

  • LINK program1,program2 LOAD(lm)

If your program makes external references, you must request that the linkage editor search the library to resolve them. To do this, include in your link request the name of the library to be searched.

  • LINK program1 COBLIB LIB('saleslib.lib.subrt2')

A request coded this way, searches SYS1.COB2LIB and SALESL1B.LIB.SUBRT2 to resolve external references.You can also specify link-edit options in the link statement:

  • LINK programl LOAD(lm) LET

Input to the Linkage Editor

Your input to the linkage editor can be:

  • One or more object modules (created through the OBJECT or DECK compile-time option)
  • Linkage editor control statements (NAME and ALIAS) generated by the NAME compiler option
  • Previously link-edited load modules you want to combine into one load module
  • COBOL subroutine libraries (SYSLIB)

Primary input to the linkage editor consists of a sequential data set that contains one or more separately compiled object modules, possibly with linkage editor control statements. Specify the primary input data set with the SYSLIN DD statement.

Secondary input to the linkage editor consists of object modules or load modules that are not part of the primary input data set but are to be included in the load module as the automatic call library. The automatic call library" contains load modules or object modules to be used as secondary input to the linkage editor to resolve external symbols left undefined after all primary input has been processed. The automatic call library may be in the form of:

  • Libraries containing object modules, with or without linkage editor control statements
  • Libraries containing load modules
  • The COBOL subroutine library, if any of the library routines are needed to resolve external references

Secondary input is composed of either all object modules or all load modules, but it cannot contain both types.

Specify the secondary input data sets with a SYSL1B DD statement and, if the data sets are object modules, add the linkage editor LIBRARY and INCLUDE control statements. If you have multiple secondary input data sets, concatenate them, as shown in the following example:

Input to the Linkage Editor

In this case, both the COBOL subroutine library and the partitioned data set (library) named SALESLIB are available as the automatic call library. The linkage editor LIBRARY control statement has the effect of concatenating any specified member names with the automatic call library.

Output from the Linkage Editor

SYSLMOD and SYSPRINT are the data sets used for linkage editor output. The output from the linkage editor varies, depending on the options you select, as shown below:

  • A map of the load modules generated by the linkage editor ( MAP)
  • A cross-reference list of data variables (XREF)
  • Informative messages (Default)
  • Diagnostic messages (Default) |
  • Listing of the linkage editor control statements (LIST)
  • One or more load modules (which you must assign to a library) (Default)

You will always receive diagnostic and informative messages as the result of link-editing. You can get the other output items by specifying options in the PARM parameter in the EXEC statement in your JCL for link-editing.

The load modules created are written in the data set defined by the SYSLMOD DD statement in your JCL for link-editing. All diagnostic output to be listed is written in the data set defined by the SYSPRINT DD statement.

Link-edit options can be specified in either of two ways:

  • Through JCL
  • Through the TSO LINK command

In your JCL for link-edit processing, use the PARM statement to specify link-edit options:

Output from the Linkage Editor

  • link-edit-options - A»list of link-edit options. Separate the link-edit options with commas.

TSO users specify link-edit options through the LINK command. For example, to use the MAP, LET, and NOCALL options when the object module in: ALEX.PRG001.OBJ is placed in ALEX.PRGOOI.LOAD(LM), use the command:

Output from the Linkage Editor

You can use link-edit-options to display a map listing at your terminal:

Output from the Linkage Editor


All rights reserved © 2018 Wisdom IT Services India Pvt. Ltd DMCA.com Protection Status

IBM Mainframe Topics