Question on Program-ID in COBOL.

All sort of Mainframes Interview Questions.
Post Reply
Radhika Apte
Registered Member
Posts: 15
Joined: Mon Jan 11, 2016 3:17 pm

Question on Program-ID in COBOL.

Post 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?
User avatar
Robert Sample
Global Moderator
Global Moderator
Posts: 1896
Joined: Fri Jun 28, 2013 1:22 am
Location: Dubuque Iowa
United States of America

Re: Question on Program-ID in COBOL.

Post 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.
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.”