IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Steps while compiling Cobol+DB2 pgm


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
mfsiri

New User


Joined: 10 Jan 2006
Posts: 5

PostPosted: Tue Mar 21, 2006 5:52 pm
Reply with quote

Hi,

1) I would like to know steps whils compiling Cobol + DB2 pgm.

2) How many packages & plans require if a pgm calling 1 pgm ?

3) How many packages & plans require if a pgm calling more than 1 pgm ?


Advance thanks
Back to top
View user's profile Send private message
mfsiri

New User


Joined: 10 Jan 2006
Posts: 5

PostPosted: Wed Mar 22, 2006 9:39 am
Reply with quote

any one pls answer my below questions.
Back to top
View user's profile Send private message
philipraju
Warnings : 1

New User


Joined: 16 Apr 2006
Posts: 29

PostPosted: Sun Apr 16, 2006 1:02 pm
Reply with quote

hi,any one please give the answers to above question
Back to top
View user's profile Send private message
prakash271082

New User


Joined: 09 Sep 2005
Posts: 53

PostPosted: Tue Apr 18, 2006 10:46 am
Reply with quote

Hi,

The Compiling Steps for a Cobol - DB2 program is,
1. Precompile - DBRM and Modified Source program.
2. Compile, Linkedit.
3. Bind & Run.

For your questions 2 and 3, I hope only one plan is enough.
Back to top
View user's profile Send private message
twissi

Active User


Joined: 01 Aug 2005
Posts: 105
Location: Somerset, NJ

PostPosted: Tue Apr 18, 2006 11:46 am
Reply with quote

Hi Siri,

The best way to explain your doubts is through ENDEVOR (CA-ENDEVOR, a third party software).

Compile your program as a COB3D type (COBOL+DB2) and successful compilation produces the LOAD & DBRM. Use DBRM for binding and LOAD to execute the program.

If you have connected programs (one calling the other), you'll need as many number of packages as the number of programs. Here, this includes the calling as well as the called program. And only one PLAN.

For example, if your main program calls two other programs, you will need 3 PACKAGEs and 1 PLAN.

Hope this's clear.

Cheers, Twissi.
Back to top
View user's profile Send private message
Rampras

New User


Joined: 18 Apr 2006
Posts: 2

PostPosted: Tue Apr 18, 2006 1:59 pm
Reply with quote

Hello,

A few more additions...

1. When you use version control tool like Endevor, you'll have to create a bind card in the Global packlib PDS (installation specific...you can ask your DBA) before you can add the new COBOL DB2 program.

2. You'll require a package for your called module only if your called module has SQL statements in it.
Back to top
View user's profile Send private message
abhicet2003

New User


Joined: 16 Nov 2005
Posts: 21

PostPosted: Sun Apr 23, 2006 12:42 pm
Reply with quote

If i want to use only packages and no plans for reducing bind costs.Is it possible to omit bind process?
Because here most of replies mentioned that using packages alone reduces binding cost.Is it possible to execute program with out binding.

Thanks
Back to top
View user's profile Send private message
twissi

Active User


Joined: 01 Aug 2005
Posts: 105
Location: Somerset, NJ

PostPosted: Fri May 12, 2006 2:26 pm
Reply with quote

Hi abhicet2003,

I don't think you can execute a program using a PACKAGE because it will not have the access path defined!

To execute a COBOL DB2 program, you'll have to use a PLAN for sure.

Please tell us more about the program and how is it compiled, any other relevant information, so on and so forth.

Cheers, Twissi.
Back to top
View user's profile Send private message
parikshit123

Active User


Joined: 01 Jul 2005
Posts: 269
Location: India

PostPosted: Fri May 12, 2006 3:06 pm
Reply with quote

Hi,

You may find this document helpful !

Thanks,
Parikshit
Back to top
View user's profile Send private message
nikitha

New User


Joined: 17 May 2006
Posts: 2

PostPosted: Wed May 17, 2006 12:10 pm
Reply with quote

hi
Back to top
View user's profile Send private message
humpty
Warnings : 1

New User


Joined: 01 May 2005
Posts: 23

PostPosted: Fri May 26, 2006 9:54 am
Reply with quote

hi mfsiri,

the cobol+db2 program goes in this manner.
we have a source module (cobol program).
the first step is precompile.
during precompilation three steps are perfomed.
1). All the SQL statements in the program are extracted in DBRM.
2). All the SQL statements embedded within delimiters calls the DB2
runtime modules and are replaced by applicable parameters.
3). A consistency token(timestamp) is generated for both the DBRM and the modified source obtained after replacing all the SQL statements from the source module, to make sure that both are interrelated.

Now the flow of is divided into two coz we are left with the MODIFIED SOURCE and the DBRM.

From this step the modified source ic compiled to get the object module and link edited to get the load module.
on the other hand, the DBRM is BIND into PLAN or PACKAGE. BIND is just like the compiler for the SQL statements.

PLAN contains the logic used by the OPTIMIZER. The input to a plan is
a). One DBRM or more than one DBRM or
b). One PACKAGE or more than one PACKAGE or
c). Combination of both DBRM and PACKAGE.
The output of a PLAN is executable application which runs in conjunction with the load module obtained.

whereas, the input to PACKAGE is only one DBRM and the output is not executable. The PACKAGE has to be ultimately BIND into PLAN.

Now to the number of PACKAGEs and PLAN is concerned when a one pgm or more than one pgm is called. so it depends on you. you can bind as many as packages as you want but all the packages has to be ultimately changed into PLAN.

one benefit of the PACKAGE is that if you make changes in the program you only need to rebind the package and not the whole PLAN.

i think that answers your question.

thanks.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts Replace each space in cobol string wi... COBOL Programming 3
No new posts COBOL -Linkage Section-Case Sensitive COBOL Programming 1
No new posts COBOL ZOS Web Enablement Toolkit HTTP... COBOL Programming 0
No new posts Calling DFSORT from Cobol, using OUTF... DFSORT/ICETOOL 5
No new posts Generate random number from range of ... COBOL Programming 3
Search our Forums:

Back to Top