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

COBOL - DB2 Program Changes


IBM Mainframe Forums -> DB2
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Chetan Kumar

New User


Joined: 03 Dec 2012
Posts: 46
Location: India

PostPosted: Thu Oct 08, 2015 5:07 pm
Reply with quote

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
View user's profile Send private message
Nic Clouston

Global Moderator


Joined: 10 May 2007
Posts: 2455
Location: Hampshire, UK

PostPosted: Thu Oct 08, 2015 5:55 pm
Reply with quote

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
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10872
Location: italy

PostPosted: Thu Oct 08, 2015 6:14 pm
Reply with quote

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
View user's profile Send private message
Rohit Umarjikar

Global Moderator


Joined: 21 Sep 2010
Posts: 3048
Location: NYC,USA

PostPosted: Fri Oct 09, 2015 12:07 am
Reply with quote

A typical Interview question.
You should check over this forum first and then you can save your time expecting answers.
e.g.
ibmmainframes.com/viewtopic.php?t=46875&highlight=db2
Back to top
View user's profile Send private message
Chetan Kumar

New User


Joined: 03 Dec 2012
Posts: 46
Location: India

PostPosted: Fri Oct 09, 2015 9:34 am
Reply with quote

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
View user's profile Send private message
daveporcelan

Active Member


Joined: 01 Dec 2006
Posts: 792
Location: Pennsylvania

PostPosted: Fri Oct 09, 2015 5:28 pm
Reply with quote

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
View user's profile Send private message
Chetan Kumar

New User


Joined: 03 Dec 2012
Posts: 46
Location: India

PostPosted: Fri Oct 09, 2015 5:38 pm
Reply with quote

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
View user's profile Send private message
daveporcelan

Active Member


Joined: 01 Dec 2006
Posts: 792
Location: Pennsylvania

PostPosted: Fri Oct 09, 2015 5:56 pm
Reply with quote

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
View user's profile Send private message
Nic Clouston

Global Moderator


Joined: 10 May 2007
Posts: 2455
Location: Hampshire, UK

PostPosted: Fri Oct 09, 2015 7:13 pm
Reply with quote

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
View user's profile Send private message
Nic Clouston

Global Moderator


Joined: 10 May 2007
Posts: 2455
Location: Hampshire, UK

PostPosted: Mon Oct 12, 2015 5:34 pm
Reply with quote

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
View user's profile Send private message
Chetan Kumar

New User


Joined: 03 Dec 2012
Posts: 46
Location: India

PostPosted: Fri Oct 16, 2015 11:54 am
Reply with quote

Hi Nic,

Sorry for that, I saw the PM option available and just sent a message.
I didn't know.
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 -> DB2

 


Similar Topics
Topic Forum Replies
No new posts Replace each space in cobol string wi... COBOL Programming 2
No new posts Using API Gateway from CICS program CICS 0
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
Search our Forums:

Back to Top