Page 1 of 1

Question on Program-ID in COBOL.

Posted: Sat Aug 06, 2022 6:10 pm
by Radhika Apte
Hi,

I had the following question in an interview;

I've 4 programs. Their names are different but they have same PROGRAM-ID, in the identification division. Can this cause a problem or what happens because of this?

I said this may fail?

Re: Question on Program-ID in COBOL.

Posted: Mon Aug 08, 2022 8:26 pm
by Robert Sample
The PROGRAM-ID is used by the linkage editor / binder to name the load module. So having four different programs using the same PROGRAM-ID means that only the last program compiled will be able to use that name.

This assumes that there are no linkage editor / binder statements provided; if they are provided, then what happens depends on what the statements are and the compile order for the four programs.