Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

COBOL - DB2 Program Changes

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2
View previous topic :: :: View next topic  
Author Message
Chetan Kumar

New User


Joined: 03 Dec 2012
Posts: 35
Location: India

PostPosted: Thu Oct 08, 2015 5:07 pm    Post subject: COBOL - DB2 Program Changes
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: 1713
Location: UK

PostPosted: Thu Oct 08, 2015 5:55 pm    Post subject:
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

Global Moderator


Joined: 14 Mar 2007
Posts: 10202
Location: italy

PostPosted: Thu Oct 08, 2015 6:14 pm    Post subject: Reply to: COBOL - DB2 Program Changes
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

Senior Member


Joined: 21 Sep 2010
Posts: 1609
Location: NY,USA

PostPosted: Fri Oct 09, 2015 12:07 am    Post subject:
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.
http://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: 35
Location: India

PostPosted: Fri Oct 09, 2015 9:34 am    Post subject: Reply to: COBOL - DB2 Program Changes
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: 645
Location: Pennsylvania

PostPosted: Fri Oct 09, 2015 5:28 pm    Post subject:
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: 35
Location: India

PostPosted: Fri Oct 09, 2015 5:38 pm    Post subject: Reply to: COBOL - DB2 Program Changes
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: 645
Location: Pennsylvania

PostPosted: Fri Oct 09, 2015 5:56 pm    Post subject:
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: 1713
Location: UK

PostPosted: Fri Oct 09, 2015 7:13 pm    Post subject:
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: 1713
Location: UK

PostPosted: Mon Oct 12, 2015 5:34 pm    Post subject:
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: 35
Location: India

PostPosted: Fri Oct 16, 2015 11:54 am    Post subject: Reply to: COBOL - DB2 Program Changes
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    IBMMAINFRAMES.com Support Forums -> DB2 All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts IMS BMP program causes 878 system abend Artemk IMS DB/DC 7 Tue Nov 22, 2016 8:26 pm
This topic is locked: you cannot edit posts or make replies. RANDOM Function in COBOL swapnil781 COBOL Programming 2 Tue Nov 15, 2016 6:17 pm
No new posts Regarding COBOL Stored Procedure opti... selvamsrinivasan85 DB2 4 Fri Nov 04, 2016 8:57 pm
No new posts COBOL Version 6.1 Virendra Shambharkar COBOL Programming 5 Tue Nov 01, 2016 11:24 am
No new posts Cobol list of programs being called biswajit.dattagupta COBOL Programming 5 Tue Nov 01, 2016 2:10 am


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us