Using DD Statements for the standard data sets - prelinker

The prelinker always requires three standard data sets. You must define these data sets in DD statements with the ddnames SYSIN, SYSMOD, and SYSMSGS.

You may need five other data sets that are defined by DD statements with the names STEPLIB, SYSLIB, SYSDEFSD, SYSOUT, and SYSPRINT. For a list of the data sets and their usage see Table 1. For details on the attributes of specific data sets see Description of data sets used.

Table 1. Data sets used for prelinking
ddname Type Function
SYSIN Input Primary input data, usually the output of the compiler
SYSMSGS Input Location of prelinker message file
STEPLIB2 Utility Library Location of prelinker and Language Environment® runtime data sets
SYSLIB Library Secondary input
SYSDEFSD1 Output Definition side-deck
SYSOUT Output Prelinker Map
SYSMOD Output Output data set for the prelinked object module
SYSPRINT Output Destination of error messages generated by the prelinker
User-specified Input Obtain additional object modules and load modules
Notes:
1
Required output from the prelinker if you are exporting variables or functions.
2
Optional data sets, if the compiler and runtime library are installed in the LPA or ELPA. To save resources and improve compile time, especially in z/OS® UNIX System Services, do not unnecessarily specify data sets on the STEPLIB DD name.

Primary input (SYSIN)

Primary input to the prelinker consists of a sequential data set, a member of a partitioned data set, or an inline object module. The primary input must consist of one or more separately compiled object modules or prelinker control statements. (See INCLUDE control statement.)

If the primary input to the prelinker consists of a mix of object modules and include control statements, include control statements must be placed last (or after all object modules).

If you are prelinking an application that imports symbols from a DLL, you must include the definition side-deck for that DLL in SYSIN. The prelinker uses the definition side-deck to resolve external symbols for functions and variables that are imported by your application. If you call more than one DLL, you need to include a definition side-deck for each.

Prelinker message file (SYSMSGS)

With this DD statement name, you provide the prelinker with the information it needs to generate error messages and the Prelinker Map.

Prelinker and Language Environment library (STEPLIB)

To prelink your program, the system must be able to locate the data sets that contain the prelinker and Language Environment runtime library. The DD statement with the name STEPLIB points to these data sets. If the runtime library is installed in the LPA or ELPA, it is found automatically. Otherwise, SCEERUN and SCEERUN2 must be in the JOBLIB or STEPLIB. For information on the search order, see Running a C or C++ application.

Secondary input (SYSLIB)

Secondary input to the prelinker consists of object modules that are not part of the primary input data set, but are to be included in the output prelinked object module from the automatic call library. The automatic call library contains object modules that will be used as secondary input to the prelinker to resolve external symbols left undefined after all the primary input has been processed. Concatenate multiple object module libraries by using the DD statement with the name SYSLIB. For more information on concatenating data sets, see Specifying include files.

Note: SYSLIB data sets that are used as input to the prelinker must be cataloged.

Definition side-deck (SYSDEFSD)

The prelinker generates a definition side-deck if you are prelinking an application that exports external symbols for functions and variables (a DLL). You must provide this side-deck to any user of your DLL. The users of the DLL must prelink the side-deck of the DLL with their other object modules. The definition side-deck (SYSDEFSD) is not generated if the NODYNAM option is in effect.

Listing (SYSOUT)

If you specify the MAP prelinker option, the prelinker writes a map to the SYSOUT data set. This map provides you with warnings, files that are included in input to the prelinker, and names of external symbols.

Output (SYSMOD)

The prelinker produces a single prelinked object module, and stores it in the SYSMOD data set. The linkage editor uses this data set as input.

Prelinker error messages (SYSPRINT)

If the prelinker encounters problems in its attempt to prelink your program, it generates error messages and places them in the SYSPRINT data set.