Cobol + DB2 Query



Support for OS/VS COBOL, VS COBOL II, COBOL for OS/390 & VM and Enterprise COBOL for z/OS

Cobol + DB2 Query

Postby Vineet » Wed Sep 15, 2010 2:57 pm

Hi All,

I am having a Query Related To COBOL + DB2 Pgm.(Batch). Query is:

Say There is a Parent Pgm. A Which Calls Pgm. B, Pgm. C & Pgm. D. Change is made To Pgm. D. Then.

Scenario - 1: If All Sub Pgm. Are Static Call

1. Do I need To Rebind the Pkg. i.e. Rebind All Pgm From. A To D To Avoid SQLCODE = -818. Or Compile On Pgm.D. If yes the will there be any Timestamp Mismatch Problem be there.

2. If Sub Pgm. D is Called in More Than One Pgm. Do I Need To Rebind All the Pgms.

Scenario -2 : If All Sub Pgm. Are Dynamic Call.

1. Do I need to Compile Pgm. D Only. If Yes then, at Run Time When Sub Pgm. D is called By Parent Pgm. A, will there be any Timestamp Missmatch.

2. If Sub Pgm. D is Called in More Than One Pgm. Do I Need To Rebind All the Pgms.

Thanks
Kind Rgds

Vineet Anand.
Vineet
 
Posts: 86
Joined: Tue Jun 19, 2007 11:38 am
Has thanked: 0 time
Been thanked: 0 time

Re: Cobol + DB2 Query

Postby Balua2g » Tue Sep 21, 2010 4:36 pm

Hi Vineet,

For Static calls, If your sub program under gone any change, then you need to recompile your main program to pick the newest version of your sub program.

For dynamic calls, you need not to recompile your main program, it will automatically pick the new version of you sub program.

Thanks,
Balakrishna Reddy.
Balua2g
 
Posts: 2
Joined: Tue Sep 21, 2010 4:26 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Cobol + DB2 Query

Postby Vineet » Tue Sep 21, 2010 6:22 pm

Hi Bala,

Thanks for the Reply. I am having a Query.For Static Call I need to Compile main Pgm. when we Talk about the Concept of Pkg. it States Advantage of Pkg. is No need to Compile entire only The Changed Pgm. Can be Compiled. For Dynamic Call, when Subroutine is called will there be any Mismatch regarding Time Stamp. please correct me if I am wrong.

If The call is static 7 same sub routine being called in Multiple Pgm's do we need to recompile all the Pgms.

Thanks
Vineet
 
Posts: 86
Joined: Tue Jun 19, 2007 11:38 am
Has thanked: 0 time
Been thanked: 0 time

Re: Cobol + DB2 Query

Postby dick scherrer » Tue Sep 21, 2010 11:12 pm

Hello,

If The call is static 7 same sub routine being called in Multiple Pgm's do we need to recompile all the Pgms.
Yes - otherwise when these are executed, they will still call the already-linked-in subprograms rather than the modified code. . .
Hope this helps,
d.sch.
User avatar
dick scherrer
Global moderator
 
Posts: 6268
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 93 times

Re: Cobol + DB2 Query

Postby GuyC » Wed Sep 22, 2010 3:20 pm

dick scherrer wrote:Hello,

If The call is static 7 same sub routine being called in Multiple Pgm's do we need to recompile all the Pgms.
Yes - otherwise when these are executed, they will still call the already-linked-in subprograms rather than the modified code. . .

which can be a desired effect.
Suppose extra functionality is added to a sub-program (depending on a input parm)
There is no business requiement to (immediately) recompile programs using the already existing functionality .
With dynamic calls this isn't a problem.
When static calls are used and both versions of the package of the subprogram are available (use versioning with your binds/packages) this would still work .
I can explain it to you, but i can not understand it for you.
GuyC
 
Posts: 315
Joined: Tue Aug 11, 2009 3:23 pm
Has thanked: 1 time
Been thanked: 4 times

Re: Cobol + DB2 Query

Postby dick scherrer » Wed Sep 22, 2010 11:07 pm

Hello,

To repeat. . .
Yes - otherwise when these are executed, they will still call the already-linked-in subprograms rather than the modified code. . .


If one wants to use the "old" executable, surely they can, but this is far less common that using the "current" code . . .

Most organizations want "the module" to be "the module" - not some earlier rendition of the code. If there is actually a need for both, the new module is most often given a new name.
Hope this helps,
d.sch.
User avatar
dick scherrer
Global moderator
 
Posts: 6268
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 93 times


Return to IBM Cobol

 


  • Related topics
    Replies
    Views
    Last post