COBOL+DB2 program question

All sort of Mainframes Interview Questions.
Post Reply
Vinay1234
New Member
Posts: 6
Joined: Thu Sep 03, 2015 7:40 pm

COBOL+DB2 program question

Post 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?
User avatar
Anuj Dhawan
Founder
Posts: 2802
Joined: Sun Apr 21, 2013 7:40 pm
Location: Mumbai, India
Contact:
India

Re: COBOL+DB2 program question

Post 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.
Thanks,
Anuj

Disclaimer: My comments on this website are my own and do not represent the opinions or suggestions of any other person or business entity, in any way.
User avatar
Anuj Dhawan
Founder
Posts: 2802
Joined: Sun Apr 21, 2013 7:40 pm
Location: Mumbai, India
Contact:
India

Re: COBOL+DB2 program question

Post 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.
Thanks,
Anuj

Disclaimer: My comments on this website are my own and do not represent the opinions or suggestions of any other person or business entity, in any way.
Vinay1234
New Member
Posts: 6
Joined: Thu Sep 03, 2015 7:40 pm

Re: COBOL+DB2 program question

Post by Vinay1234 »

Thanks Anuj.
User avatar
Anuj Dhawan
Founder
Posts: 2802
Joined: Sun Apr 21, 2013 7:40 pm
Location: Mumbai, India
Contact:
India

Re: COBOL+DB2 program question

Post by Anuj Dhawan »

You're welcome.
Thanks,
Anuj

Disclaimer: My comments on this website are my own and do not represent the opinions or suggestions of any other person or business entity, in any way.
Post Reply

Create an account or sign in to join the discussion

You need to be a member in order to post a reply

Create an account

Not a member? register to join our community
Members can start their own topics & subscribe to topics
It’s free and only takes a minute

Register

Sign in

Return to “Interview Questions.”