Page 1 of 1

Cobol + DB2 Query

PostPosted: Wed Sep 15, 2010 2:57 pm
by Vineet
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.

Re: Cobol + DB2 Query

PostPosted: Tue Sep 21, 2010 4:36 pm
by Balua2g
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.

Re: Cobol + DB2 Query

PostPosted: Tue Sep 21, 2010 6:22 pm
by Vineet
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

Re: Cobol + DB2 Query

PostPosted: Tue Sep 21, 2010 11:12 pm
by dick scherrer
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. . .

Re: Cobol + DB2 Query

PostPosted: Wed Sep 22, 2010 3:20 pm
by GuyC
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 .

Re: Cobol + DB2 Query

PostPosted: Wed Sep 22, 2010 11:07 pm
by dick scherrer
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.