Compile/Link-Edit and Run JCLs - IBM Mainframe

Before a program can be executed, it has to be compiled and linked. Compilation of program results in the creation of assembly language code, which is further, converted into machine language code. This chapter will discuss the utilities used for compiling, link-editing and executing a program

Program Life Cycle

The different phases of the program life cycle are:

  • Creation of source code - In IBM mainframe environment a COBOL program is typed at the terminal using the ISPF editor, and is used as a PDS member. This is called the source code. Once the program has been saved, the next step is its compilation. This is done through a compiler.
  • Compilation - A compiler is a language translator. The compiler takes the source code and translates it into re-locatable object code. It also supplies instructions necessary to debug a program, if the program is compiled with the debug" option. Re-locatable object code also contains machine language instructions, which the linker understands. Processing is now transferred to the Linkage-editor.
  • Link-editing - The Linkage-editor combines the re-locatable object code of the source file with the re-locatable source code of any pre-compiled sub-routines or external procedures that the program may reference. The Linkage-editor produces the final version of the program that is now in a format that is comprehensible to the computer; this is called executable code.

The Compiler Program (IKFCBL00)

The compiler program called IKFCBL00 is executed to compile the COBOL source code. Several options can be specified to this program using the PARM parameter.

A DD statement called SYSLIN must always be coded. The SYSLIN statement is used to indicate the name of the temporary data set that is created by the compiler before it is passed on to the link-edit program. A DD statement called SYSLIB must also be coded if pre-compiled subroutines are referenced by the program that is being compiled. The SYSLIB statement specifies the name of the library containing the object code of the called subroutines. The name of this library is often installation defined.

Some common compiler options are given below:

  • SEQ - checks the line sequence in COBOL source code.
  • NOSEQ - ignores sequence checking.
  • DYNAM - Load sub-modules dynamically.
  • NODYNAM - Load sub-modules at compile time. This is the default.
  • LIB - specifies that all data sets referenced in //SYSLIB should be opened automatically.
  • NOLIB - specifies that all data sets referenced must be opened via the JCL submitted. This is the default.
  • XREF - produces a sorted cross-reference. No cross-reference is the default.
  • CLI - produces condensed listing of the machine language object code. No listing is the default

The Linkage-editor Program (IEVVL)

The Linkage-editor program takes the object code passed to it from the compiler, include the object code of any subroutines or sub-programs called by the program can creates a load module. The load module is what is called the executable code. The IEVVL program is executed to implement these functions.

A DD statement called SYSLIN must always be coded. The SYSL1N statement is used to indicate the name of the temporary dataset, which contains the object module created by the compiler. A DD statement called SYSLIB must also be coded if pre-compiled subroutines are referenced by the program that is being compiled. The SYSLIB statement specifies the name of the library containing the object code of the called subroutines. The name of this library is often installation defined. A DD statement called SYSLMOD must also be coded. This statement will define the name of the data set that will contain the load module produced by the link-edit program. A DD statement usually called SYSUTl, which defines the characteristics of the work file (scratch data set, as it is commonly called) that will be used by the link-edit program as it executes must be coded.

Some common linkage-editor options are given below:

  • XREF - produces a cross-reference of the load module.
  • LIST - produce listing of control statements used by linkage-editor. Default is NOLIST.
  • LET - create executable code despite minor error. Default is NOLET
  • AMODE=nn - specifies the type of addressing, where nn is the number specifying the type of addressing (24 or 31 bit). AMODE=ANY specifies 24 and 31 bit addressing.
  • PRINT - print output messages to specified device. NOPR1NT is default.
  • CLI - produces condensed listing of the machine language object code. No listing is the default.

Executing the program

The program can now be executed using a JCL, where you have specified the name of the program in the EXEC statement.


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

IBM Mainframe Topics