Where do the copybook "comes from" while execution?

OS/VS COBOL, COBOL II, Enterprise COBOL for z/OS. OpenCOBOL and OOCobol.
Post Reply
User avatar
AD991
Registered Member
Posts: 92
Joined: Wed May 08, 2013 7:36 pm

Where do the copybook "comes from" while execution?

Post by AD991 »

Hi,

If one particular copybook exists in multiple-libraries. Can anybody tell me how to know the copybook invoked by PGM is coming from which libraries when the program is compiled?
User avatar
Anuj Dhawan
Founder
Posts: 2802
Joined: Sun Apr 21, 2013 7:40 pm
Location: Mumbai, India
Contact:
India

Re: Where do the copybook "comes from" while execution?

Post by Anuj Dhawan »

If there's more than one libraries and they're concatenated you'll have to search each library in the concatenation. Depending on your shop set-up your particular compile may give you some insight into which lib in the concatenation might contain the copybook. There is no magic about it.

Also, in a standard COBOL compile the copybook lib(s) are pointed to by the SYSLIB DD in the compile step JCL - so you can start from there too.
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: Where do the copybook "comes from" while execution?

Post by Anuj Dhawan »

I'm not sure if I've answered your question the way you needed but I was skeptical about your question so came back to know, if it 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
Robert Sample
Global Moderator
Global Moderator
Posts: 1895
Joined: Fri Jun 28, 2013 1:22 am
Location: Dubuque Iowa
United States of America

Re: Where do the copybook "comes from" while execution?

Post by Robert Sample »

Concatenation works the same for load libraries as well as copy books and source code ... the libraries are searched in the sequence they are specified in the JCL, and the first data set that contains the member has that member used. There may be additional data sets that contain the member below that in the concatenation sequence, but they will not be searched since the search ends once the member is located.
User avatar
BobThomas
Registered Member
Posts: 70
Joined: Sat Jun 15, 2013 11:04 am

Re: Where do the copybook "comes from" while execution?

Post by BobThomas »

Can copybook be searched in Link-List or is it applicable to programs only? Please help.
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: Where do the copybook "comes from" while execution?

Post by Robert Sample »

Link list applies only to load libraries. Hence copy books cannot be stored in the link list.
User avatar
AD991
Registered Member
Posts: 92
Joined: Wed May 08, 2013 7:36 pm

Re: Where do the copybook "comes from" while execution?

Post by AD991 »

Thanks Anuj and Robert.
User avatar
BobThomas
Registered Member
Posts: 70
Joined: Sat Jun 15, 2013 11:04 am

Re: Where do the copybook "comes from" while execution?

Post by BobThomas »

Robert Sample wrote:Link list applies only to load libraries. Hence copy books cannot be stored in the link list.
Okay, Thanks.
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 COBOL, GnuCOBOL (OpenCOBOL), OOCobol.”