Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Differences in different modules obtained after compilations

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
View previous topic :: :: View next topic  
Author Message
Bharti P Manglani

New User


Joined: 13 Mar 2007
Posts: 16
Location: Pune

PostPosted: Thu Mar 15, 2007 12:47 pm    Post subject: Differences in different modules obtained after compilations
Reply with quote

Hi all,

First i just want to say this is an excellent forum. it is really great!!!!! icon_biggrin.gif

I was going through the topics and i found the terms object module, load module, linkedit and executable very confusing in cobol mainframes.

can you please tell me the difference between an object module and a load module?

and i guess later on we linkedit it with related progs and it we get an exe file. please let me know whether i am correct in my understanding.

thanks in advance..
Back to top
View user's profile Send private message

guptae

Moderator


Joined: 14 Oct 2005
Posts: 1187
Location: Bangalore,India

PostPosted: Thu Mar 15, 2007 12:52 pm    Post subject:
Reply with quote

Hi there,

STEP 1 - DB2 PRECOMPILE

The DB2 Precompile performs three functions. First, it checks the SQL in
the program for errors. Second, it adds working storage areas and source
code compatible statements that are used to invoke DB2. One of the working
storage areas contains a literal "timestamp" called a consistency token.
Finally, all of the SQL statements are extracted from the program source
and placed into a member called the DataBase Request Module, or DBRM, which
also contains the consistency token.



STEP 2 - COMPILE

The modified source from the precompile is then compiled. The code is
checked for errors, and a compiled version of the code is created.



STEP 3 - LINK-EDIT

The compiled code is link-edited along with statically called source language
and DB2 run-time modules to create a Load Module. Imbedded in this
module is the same consistency token that was generated in the precompile.
If multiple DB2 programs are statically linked together, the resulting load
module contains a consistency token for each one.



STEP 4 - DB2 BIND

The bind process reads the DBRM that was created in the precompile and
prepares an access path to the data. This access path, along with the
consistency token, is stored in the DB2 catalog as a Package. Every Package
is bound into a Package List, or Collection. The name of the Collection is
specified by the PACKAGE parameter. A Collection is a group of Packages
that are included in one or more Plans. The QUALIFIER parameter of the
bind is used to direct the SQL to the specific set of DB2 objects (tables,
views, aliases or synonyms) qualified by this name.







EXECUTING COBOL-DB2 PROGRAM

When COBOL-DB2 Program executes, the plan name must be specified.
For online CICS programs, the plan name is specified by Tran ID in
the Resource Control Table (RCT). For a batch program, the plan name is
specified in the SYSTSIN input DD. The packages for all DB2 programs
executed under a Tran ID or batch job step must be included in collection
bound into this plan. When the first SQL statement of each program is
executed, DB2 searches the collections within the plan using the package name
and consistency token from the load module. If an exact match is not
found, a -805 SQLCODE is returned.
Back to top
View user's profile Send private message
Shobana Bhaskar

New User


Joined: 02 Mar 2007
Posts: 35
Location: Pennsylvania, US

PostPosted: Thu Mar 15, 2007 1:38 pm    Post subject:
Reply with quote

Wow simply great explanation!!

Can u clarify the difference between Plan and package??

Also am not clear about the term "consistency token".
You have mentioned as Statically... Then what happens for Dynamically called modules?
Back to top
View user's profile Send private message
Bharti P Manglani

New User


Joined: 13 Mar 2007
Posts: 16
Location: Pune

PostPosted: Thu Mar 15, 2007 1:41 pm    Post subject: Re: Differences in different modules obtained after compilat
Reply with quote

Hi Ekta,

thanks for such a wonderful explanation!!

i actually work in COBOL-VSAM, not DB2. Will this be applicable to VSAM also? and does this load module, object module concept apply to everywhere or it is DB2 only?
Back to top
View user's profile Send private message
guptae

Moderator


Joined: 14 Oct 2005
Posts: 1187
Location: Bangalore,India

PostPosted: Thu Mar 15, 2007 1:50 pm    Post subject:
Reply with quote

Hi Shobana,

Difference between Plan & package:
Both contain optimized code for SQL statements - a package for a single
program, module or subroutine contained in the date base request module
(DBRM) library. A plan may contain multiple packages and pointers to
packages.
A plan is an executable module containing the access path logic produced by
the DB2 optimizer. It can be composed of one or more DBRMs and packages.
Before a DB2 for z/OS program (with static SQL) can be run, it must have a
plan associated with it.
Plans are created by the BIND command. The plan is stored in the DB2
directory and accessed when its program is run. Information about the plan is
stored in the DB2 catalog.
A package is a single, bound DBRM with optimized access paths. By using
packages, the table access logic is "packaged" at a lower level of granularity
than a plan -- at the package (or program) level.
To execute a package, you first must include it in the package list of a plan.
Packages are not directly executed, they are only indirectly executed when
the plan in which they are contained executes -- as discussed previously,
UDFs and triggers are exceptions to this rule. A plan can consist of one or
more DBRMs, one or more packages or, a combination of packages and
DBRMs.
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Thu Mar 15, 2007 8:26 pm    Post subject:
Reply with quote

Hello,

These:
Quote:
object module, load module, linkedit and executable
are basically the same for all COBOL programs.

The object module is the output from a compile.

The load module is the output of the linkedt.

Linkedt is the process that resolves addresses from all of the modules included in the link making an executable (load) module.

An executable is a load module - there are no .exe files on the mainframe. Members of load libraries (LOADLIB) are executables.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Could we identify the called modules ... elixir1986 COBOL Programming 5 Fri Jul 14, 2017 1:53 am
No new posts Cobol upgrade - source code missing f... gthmrj IBM Tools 1 Wed Apr 26, 2017 6:04 pm
No new posts Copy load modules and alias vasanthz IBM Tools 5 Thu Apr 20, 2017 6:31 am
No new posts Differences between copying members b... E.LAI TSO/ISPF 8 Wed Mar 30, 2016 12:35 pm
No new posts How to find possible traces of ARCH 7... Prosenjit2011 All Other Mainframe Topics 5 Mon Aug 17, 2015 10:53 am

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us