Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Copybook structure in Load module

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
View previous topic :: :: View next topic  
Author Message
Vai123

New User


Joined: 04 Dec 2008
Posts: 3
Location: Bangalore

PostPosted: Fri Sep 16, 2016 8:29 pm    Post subject: Copybook structure in Load module
Reply with quote

Hi,

Does Cobol load module already contains the copybook structure? If yes, next question is-
Suppose Copybook ABC is used by programs P1 and P2. I updated the copybook for program P1. Why program P2 is also compiled though it is using its compatible version in load module?

I tried to search this topic but could not find relevant post.
Back to top
View user's profile Send private message

RahulG31

Active User


Joined: 20 Dec 2014
Posts: 331
Location: USA

PostPosted: Fri Sep 16, 2016 8:35 pm    Post subject: Reply to: Copybook structure in Load module
Reply with quote

The question is Unclear.

You don't necessarily need to compile P2 if you don't want to.

.
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 7905
Location: Bellevue, IA

PostPosted: Fri Sep 16, 2016 9:01 pm    Post subject:
Reply with quote

Copybooks are NOT used in a load module - they are source code only. A copybook defines a data structure, which is used by the load module, but the load module has no concept of the copybook.

A change to copybook ABC may be compatible or incompatible. Compatible changes do not change the existing variable definitions nor do they change the length of the defined record (adding a variable to the end of the definition and removing that many bytes of filler is an example of a compatible change). An incompatible change is one that changes the length of the record or inserts one or more variables, or changes the length of variables other than the last one, or deletes variables, or changes a variable USAGE, or rearranges the sequence of variables.

Compatible changes do NOT require any other programs to be recompiled -- just the program(s) affected by the change. Incompatible changes require every program that uses the copybook to be recompiled. Many sites, rather than figure out whether the change is compatible or not, will just recompile every program using the copybook whether or not such a recompile is required. Incompatible changes can cause all sorts of issues should every program using the copybook not be recompiled.
Back to top
View user's profile Send private message
Pandora-Box

Moderator


Joined: 07 Sep 2006
Posts: 1529
Location: Andromeda Galaxy

PostPosted: Fri Sep 16, 2016 9:15 pm    Post subject:
Reply with quote

The issue here is you are making an object to become inconsistent which is starting point of a failure.
Back to top
View user's profile Send private message
Rohit Umarjikar

Senior Member


Joined: 21 Sep 2010
Posts: 1609
Location: NY,USA

PostPosted: Fri Sep 16, 2016 9:43 pm    Post subject:
Reply with quote

Vaishnavi,
Quote:
Does Cobol load module already contains the copybook structure? If yes
No, you could have looked yourself, hence the next question goes away automatically. For the point if you change the copybooks then certainly, you would want your programs to use the latest offsets otherwise you will expect errors like SOC4/SOC7 and if you chose to use the changeman ( other version control tool ) then it won't pass the Audit unless you recompile the program checked out in that package.
Quote:
Why program P2 is also compiled though it is using its compatible version in load module?
if the program P2 is in production then you don't have to but if they sitting in the same package and going together in production then yes.
Back to top
View user's profile Send private message
Vai123

New User


Joined: 04 Dec 2008
Posts: 3
Location: Bangalore

PostPosted: Fri Sep 16, 2016 10:10 pm    Post subject: Reply to: Copybook structure in Load module
Reply with quote

Very good information, Robert.. Thanks icon_smile.gif

Let me rephrase my question. Does load module already contain declaration of copybook variables like normal working storage variables?
Back to top
View user's profile Send private message
Vai123

New User


Joined: 04 Dec 2008
Posts: 3
Location: Bangalore

PostPosted: Fri Sep 16, 2016 10:13 pm    Post subject: Reply to: Copybook structure in Load module
Reply with quote

This question is more from the informative purpose and precaution to avoid program malfunction.
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 7905
Location: Bellevue, IA

PostPosted: Fri Sep 16, 2016 10:37 pm    Post subject:
Reply with quote

A load module does not contain declarations of any variables; it contains storage for WORKING-STORAGE variables (whether declared in a copybook or in the actual program does not matter), and the program executable code works with offsets to registers to address the various bytes of memory. So, technically, a load module doesn't even reference variables as they are defined to the COBOL program -- it references memory locations and lengths. Note that copybooks that define records in the FD do not have memory allocated until the file OPEN occurs, so the load module may not have storage allocated for a copybooks at all.

You need to rid yourself of the idea that the executable code has any understanding of the data structures in the source code -- this simply is not the case. There are products that can retain the data structures and map them to memory when the program is executing, but these products generally work by making a copy of the data structures during the compile process so the copy can be referenced during execution. COBOL itself has nothing to do with such a process.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Need Rexx Program to Load in to DB2 T... Hareesh Verma CLIST & REXX 22 Tue Sep 20, 2016 2:59 pm
This topic is locked: you cannot edit posts or make replies. ERROR WHILE SUBMITTING LOAD JOB ANURADHA NEELAKANTAN JCL & VSAM 12 Thu Aug 25, 2016 11:50 am
No new posts Execute multiple DB2 Load commands in... faizm DB2 4 Wed Aug 03, 2016 12:53 pm
No new posts How to get the program name of callin... pkmurali COBOL Programming 8 Mon Aug 01, 2016 3:36 am
No new posts Search a Load Module sreekanth1984 TSO/ISPF 8 Tue Jun 07, 2016 8:45 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us