Chapter Contents

Previous

Next
Linking C Programs

Linking Programs in TSO

The following sections describe how to link your C program in TSO.


The COOL CLIST

The COOL CLIST invokes the COOL object code preprocessor, followed by the linkage editor. Optionally, the COOL step can be skipped. The format is as follows:

COOL dsname  [keywords]

where dsname is the name of the object data set that is to be the primary input to COOL or the linkage editor. The data set name should be the name of the data set containing the object code or the COOL/linkage editor control statements used as input, or both. (INCLUDE statements are an example of control statements, as discussed later in this chapter.) Follow standard TSO naming conventions; that is, if the data set belongs to some other user, the full name of the data set must be specified and the name must be enclosed in single quotes. If the object code is in a member of a partitioned data set, the member name must be specified in parentheses following the data set name, in the normal TSO manner. The final qualifier of the input data set name is assumed to be OBJ. If you do not add this qualifier, it is supplied automatically by the CLIST. keywords (described in the following section) indicate COOL options, linkage editor options, or the names of other data sets to use during linking.


Executing COOL with the IBM Linkage Editor

COOL accepts the NOCLINK option, which causes the linkage editor to be invoked directly without use of the COOL utility.

Linkage editor options

COOL allows you to specify any linkage editor options such as LIST , LET , MAP , XREF , TEST , RENT , OVLY , AMODE , and RMODE . (These options are valid for the linkage editor whether or not COOL is run.) The IBM MVS/XA Linkage Editor and Loader User's Guide discusses these options.


Linking All-Resident Programs

When linking an all-resident program, include an object deck created by compiling a source file that includes <resident.h> and the appropriate macro definitions. See All-Resident C Programs for more information. For example, suppose the PDS member INCNTL contains the following COOL control statements:

INCLUDE OBJLIB(MAINPROG)
INCLUDE OBJLIB(SUB1)
INCLUDE OBJLIB(SUB2)

The program also autocalls other members from MY.PROG.OBJ. Normally, the COOL command to link this program is

COOL PROG(INCNTL) LIB('''MY.PROG.OBJ''') ...

INCNTL would contain the following COOL control statements:

INCLUDE OBJLIB(MAINPROG)
INCLUDE OBJLIB(SUB1)
INCLUDE OBJLIB(SUB2)
INCLUDE OBJLIB(RESLIST)

The COOL command to link an all-resident version of this program is as follows:

COOL PROG(INCNTL) LIB('''MY.PROG.OBJ''') ALLRESIDENT


Chapter Contents

Previous

Next

Top of Page

Copyright © 2001 by SAS Institute Inc., Cary, NC, USA. All rights reserved.