Page 1 of 1

COBOL+DB2 program question

Posted: Thu Sep 03, 2015 7:52 pm
by Vinay1234
Hello everyone.. This question asked me in the interview.. Please provide the answer.

A Cobol+Db2 program moved to production and in production it failed at the Bind step. how do we identify the problem in Bind related to production? .. I mean to say in test it binded successully. where as in production it failed which parameter we need to see to correct this bind error?

Re: COBOL+DB2 program question

Posted: Thu Sep 03, 2015 8:48 pm
by Anuj Dhawan
You'll check for the timestamp in the DBRM in the production and compare it with the timestamp in your COBOL's load module. If they don't match you'll get an "abend".


The program is compiled at only one level - test. The DBRM is also created here - output of pre-compiler. When a module is promoted, through different stages, DB2 programs are rebound and go through a BIND because each stage has its own DB2 environment. If that does not happen, you'll get SQLCODE -818: The explnation for that is as follows:

Reason: THE PRECOMPILER GENERATED TIMESTAMP x IN THE LOAD MODULE IS DIFFERENT FROM THE BIND TIMESTAMP y BUILT FROM THE DBRM z

Description: The SQL precompiler places timestamp 'y' in the DBRM, and time stamp 'x' in the parameter list in the application program for each SQL statement. At BIND time, DB2 stores the DBRM timestamp for run time use. At run time, timestamp 'x', for the SQL statement being processed,is compared with timestamp 'y' derived from the DBRM 'z' at BIND time. If the two timestamps do not match, the DBRM and the application program were not the result of the same precompile. This problem can occur if you:

Precompile, compile, and link, without doing a BIND of the application, Precompile and BIND, without doing the compile and link for the application program, or BIND the application using a DBRM that resulted from a different precompile of the application program than that which produced the object module that is linked into the application module.

The timestamps 'x' and 'y' are DB2 internal timestamps. They do not have an external interpretation.

User Response: BIND the application again, using the DBRM for the application program that matches the object module.

Hope this helps.

Re: COBOL+DB2 program question

Posted: Thu Sep 03, 2015 9:17 pm
by Anuj Dhawan
Vinay1234 wrote: This question asked me in the interview.. Please provide the answer.
Hi Vinay - Per this, I've moved your question to the 'Interview Questions' part of the Forum.

Re: COBOL+DB2 program question

Posted: Thu Sep 03, 2015 9:53 pm
by Vinay1234
Thanks Anuj.

Re: COBOL+DB2 program question

Posted: Fri Sep 04, 2015 7:25 am
by Anuj Dhawan
You're welcome.