Link-edit
Joins compiled code with the other pieces it needs, and makes one program the system can run.
Also written binder, linkage editor, bind
Why it matters. Compiling is not enough. Until the link-edit, there is nothing the system can run.
Syntax
//LKED EXEC PGM=IEWL,PARM='LIST,MAP' //SYSLIN DD DSN=&&OBJSET,DISP=(OLD,DELETE) //SYSLMOD DD DSN=load.library(member),DISP=SHR
- PGM=IEWL
- The binder (the link editor's name is kept).
- SYSLIN
- The object code to bind, from the compiler.
- SYSLMOD
- The load library and member to write.
- SYSLIB
- Libraries to search for modules the program calls.
- SYSPRINT
- The binder's listing.
- PARM
- Options such as LIST, MAP, XREF and LET.
Try it IEWL
- 1
Job BUILD compiles ZBINT01 and then link-edits it. Send it from your DEV JCL library to run.
SUBMIT 'ZB0001.DEV.JCL(BUILD)' - 2
Read the output of the job. Look at what the link-edit step wrote.
OUTPUT BUILD
Remember
- Link-edit comes after the compile and before the run.
- It reads object code (SYSLIN) and writes a load module (SYSLMOD). On z/OS the program that does it is the binder, called as IEWL.
- If the compile failed, there is nothing to link, and no load module is written.
The usual mistake
A job with a compile step and a run step, and no link-edit
A compile leaves object code, not a program. EXEC PGM= cannot find a load module of that name, and the step ends with S806.
Compile, then link-edit, then run
On real z/OS
MF/OS runs the link-edit as a simulated step and doesn't write real object code or a binder listing. It doesn't produce unresolved-reference messages from a real search of libraries.
Where can I practise Link-edit?
Right here, at ZedBank. You take a junior job at a simulated bank and use Link-edit in real work, with Zed beside you. There's nothing to install.
Start at ZedBankRelated
- CompileTurning COBOL source code into machine instructions, checking the syntax and producing a listing of any errors.
- Load moduleThe runnable form of a program, stored in a library, which JCL executes by name.
- PDSEThe modern version of a partitioned dataset, which reclaims space automatically and removes the old size limits.
- COBOLThe programming language most business logic on the mainframe is written in. Verbose by design, and still running the world's payments.
- PROCA reusable piece of JCL stored as a member and invoked by name, so common steps are written once.