View previous topic :: View next topic
|
Author |
Message |
Chetan Kumar
New User
Joined: 03 Dec 2012 Posts: 46 Location: India
|
|
|
|
Hi All,
I have few questions w.r.t Cobol-Db2 code changes.
1. When we change SQL query code in a Cobol-Db2 program, is it necessary to follow the program preparation steps again (i.e Precompile-compile-link-> Load and Dbrm - Package -> Plan?
If not, then how the changed SQL code will be made available in the DBRM which is to be rebound.
2. If a Main Program is a plain COBOL Program and Sub-Program is a Cobol-DB2 Program. What are the program preparation steps for Main Program and Sub-program when called Statically and when called dynamically.
Regards,
CKumar |
|
Back to top |
|
|
Nic Clouston
Global Moderator
Joined: 10 May 2007 Posts: 2455 Location: Hampshire, UK
|
|
|
|
Quote: |
When we change SQL query code in a Cobol-Db2 program, is it necessary to follow the program preparation steps again |
How else do you expect to get an updated load module?
If your main program is unchanged then you do not need to touch it. With static linking you will, of course, need to re-link. |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10872 Location: italy
|
|
|
|
usually all depends on the development practices and the tools being used
also depending on how Your SCM is customised things might be pretty automatic
the SCM knows the modules dependencies so modifying a statically called subroutine/function
will usually result in the rebuild of the programs using it
and for the object defined as db2 dependents also all the db2 stuff executed
ask Your support |
|
Back to top |
|
|
Rohit Umarjikar
Global Moderator
Joined: 21 Sep 2010 Posts: 3048 Location: NYC,USA
|
|
Back to top |
|
|
Chetan Kumar
New User
Joined: 03 Dec 2012 Posts: 46 Location: India
|
|
|
|
Thank you. But can any body give me clarity on these queries.
What exactly happens during each scenario?
When we say : do the rebind due to some SQL code change, I mean it's complete program preparation steps again. Correct me if I'm deviating. |
|
Back to top |
|
|
daveporcelan
Active Member
Joined: 01 Dec 2006 Posts: 792 Location: Pennsylvania
|
|
|
|
What 'exactly' happens varies from shop to shop, but in general:
1) If you change your SQL, you will need to PreCompile (or equivalent), Compile, Link your program.
You need to Compile your program even though you only made an SQL change. This is so the Timestamp on the Load module matches that on the DBRM.
You will need to Bind your Package also. Binding the Plan would depend on how your Plans are setup. In our shop, we do not Bind the Plan a second time in most cases.
2) If you have a static link, then you have to re-link the caller to bring in the changes to the sub program. With a dynamic link you do not. We have very few statically linked programs in our shop. |
|
Back to top |
|
|
Chetan Kumar
New User
Joined: 03 Dec 2012 Posts: 46 Location: India
|
|
|
|
Hi Daveporcelan,
"You will need to Bind your Package also. Binding the Plan would depend on how your Plans are setup. In our shop, we do not Bind the Plan a second time in most cases. "
w.r.t to your above statement: I think, we need to do both bind package and bind plan, because when you bind package you are actually bind with the collection-id and when it comes to bind plan we make the list of collection-id's available to plan through PKLIST.
In all cases we have to Bind Package and Bind corresponding PLAN associated. |
|
Back to top |
|
|
daveporcelan
Active Member
Joined: 01 Dec 2006 Posts: 792 Location: Pennsylvania
|
|
|
|
If the PKLIST for your plan is: collid_name.* and you bind your package to collid_name, then you would not have to bind your plan again. |
|
Back to top |
|
|
Nic Clouston
Global Moderator
Joined: 10 May 2007 Posts: 2455 Location: Hampshire, UK
|
|
|
|
If you look at the cobol code that is passed from the prcompiler to the cobol compiler you will see that all the EXEC SQL stuff has been changed into comments and replaced by generated cobol code. So your cobol code has now been changed for you so you need to recompile. Is that clearer? |
|
Back to top |
|
|
Nic Clouston
Global Moderator
Joined: 10 May 2007 Posts: 2455 Location: Hampshire, UK
|
|
|
|
Chetan
I suggest you read the forum rules...
Quote: |
Don't ask via PM
Do not request help via Private messages(PM) or emails. Post all your queries on forum itself. You will be banned if we receive any complaints from other users regarding this. |
|
|
Back to top |
|
|
Chetan Kumar
New User
Joined: 03 Dec 2012 Posts: 46 Location: India
|
|
|
|
Hi Nic,
Sorry for that, I saw the PM option available and just sent a message.
I didn't know. |
|
Back to top |
|
|
|