Page 1 of 1

COBOL DB2 question

Posted: Tue Nov 29, 2022 6:10 pm
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

Re: COBOL DB2 question

Posted: Tue Nov 29, 2022 10:05 pm
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.

Re: COBOL DB2 question

Posted: Wed Nov 30, 2022 12:48 pm
by Rajeev Singh
But if the column is never referenced in the COBOL program, then? Will still be required to compile?

Re: COBOL DB2 question

Posted: Wed Nov 30, 2022 9:23 pm
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.