COBOL DB2 question

RDBMS from IBM and IBM's Hierarchical DBMS and Transaction Manager (IMS DC).
Post Reply
Rajeev Singh
New Member
Posts: 5
Joined: Sun Nov 30, 2014 7:56 am

COBOL DB2 question

Post by Rajeev Singh »

Hi,

I am working at a company which is using IMS DB and DB2 is nonexistent. However, I appeared in an interview where there was a question on DB2, and I need help for its answer. The question was like: If There is a COBOL-DB2 program which works well in production. Now if a programmer adds or say deletes one column in one of the DB2 tables used in this program, what are we supposed to do?

Can that program still executes without a change or not?

Regards
User avatar
Robert Sample
Global Moderator
Global Moderator
Posts: 1895
Joined: Fri Jun 28, 2013 1:22 am
Location: Dubuque Iowa
United States of America

Re: COBOL DB2 question

Post by Robert Sample »

If the program is using a column that is deleted from DB2, at a minimum there will be code changes required to remove the references to the deleted column.
Rajeev Singh
New Member
Posts: 5
Joined: Sun Nov 30, 2014 7:56 am

Re: COBOL DB2 question

Post by Rajeev Singh »

But if the column is never referenced in the COBOL program, then? Will still be required to compile?
User avatar
Robert Sample
Global Moderator
Global Moderator
Posts: 1895
Joined: Fri Jun 28, 2013 1:22 am
Location: Dubuque Iowa
United States of America

Re: COBOL DB2 question

Post by Robert Sample »

The answer is "it depends". For example, if the site standard is to recompile each program when a database change is made, then you recompile the program. If the column is referenced in a copy book used by the program, you need to recompile the program. As long as the column is completely unused by the program (and its copy books) then you do not need to recompile.

Recompile implies to bind the program again, of course.
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 “IBM DB2 and IMS DB/DC”