Link-editing your application using the LINK command

The LINK command invokes the linkage editor, which converts one or more object modules into an executable program suitable for execution. Later, you can run the executable program using the CALL command (see Using the CALL command to run your application). The general form of the LINK command is:

Read syntax diagramSkip visual syntax diagram
Syntax

>>-LINK--(--data-set-list--)--+---------------------------+----->
                              '-LOAD--(--data-set-name--)-'   

>--+--------------------------+--+---------+-------------------><
   '-LIB--(--data-set-list--)-'  '-options-'   

LINK (data-set-list)
Specifies the names of the data sets containing the object modules to be link-edited. The variable data-set-list must contain at least one object module, but can also contain binder control statements. If you have only one name, you can omit the parentheses. If there are several names, you must separate them by commas or blanks within the parentheses. The rules for positioning control statements in relation to object modules are the same as for batch mode. If you specify a simple data set name, the system assumes the descriptive qualifier OBJ; that is, the data set name is of the form userid.data-set-name.OBJ.
LOAD (data-set-name)
Specifies the name of the data set to contain the executable program generated by the link-edit process. If you specify a simple name, the system adds the user-identification qualifier and the descriptive qualifier LOAD (userid.data-set-name.LOAD), and uses that as the data set name. The resulting executable program must be stored as a member in a PDS or PDSE. If you do not supply a member name, the executable program is placed in member TEMPNAME of the userid.data-set-name.LOAD data set. If you do not specify LOAD, userid.LOAD is used.
LIB (data-set-list)
Specifies the names of data sets that contain user-supplied modules that you want to be link-edited by the automatic library call facility.

The appropriate link-edit libraries, including the Language Environment link-edit libraries, must be specified. See Planning to link-edit and run for a description of the Language Environment link-edit libraries.

options
Specifies a list of link-edit processing options. You must separate the options with a valid delimiter such as a comma or blank. Table 1 contains a partial listing of available link-edit options.
The following example shows how to:
  • Link-edit two object modules named PROGRAM1 and CEEUOPT. CEEUOPT can be used to establish programmer runtime option defaults. See Using runtime options for more information.
  • Load the resulting executable program in member PROGRAM1 in the library USER.LOADLIB.
  • Specify the Language Environment library CEE.SCEELKED as the automatic call library for a non-XPLINK application.
  • Generate a mapping of the executable program that is run by using the MAP option.
  • Direct the linkage editor listing to the terminal by using the PRINT(*) option.
LINK ('USER.OBJLIB(PROGRAM1)','USER.OBJLIB(CEEUOPT)')
     LOAD('USER.LOADLIB(PROGRAM1)')
     LIB ('CEE.SCEELKED') MAP PRINT(*)

For more information about using the TSO/E LINK command and its options, see z/OS TSO/E Command Reference.