Copy Book



Support for OS/VS COBOL, VS COBOL II, COBOL for OS/390 & VM and Enterprise COBOL for z/OS

Copy Book

Postby Sanket » Tue Nov 15, 2011 1:55 am

Can someone explain me the concept of Copy book?
Sanket
 
Posts: 8
Joined: Tue Nov 15, 2011 1:18 am
Has thanked: 0 time
Been thanked: 0 time

Re: Copy Book

Postby dick scherrer » Tue Nov 15, 2011 2:16 am

Hello,

A copybook is used to hold common code (often a file definition). The entire copybook is brought into the program with a single COPY statement rather than having all of the code resident in the source.
Hope this helps,
d.sch.
User avatar
dick scherrer
Global moderator
 
Posts: 6268
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 93 times

Re: Copy Book

Postby Akatsukami » Tue Nov 15, 2011 2:23 am

Sanket wrote:Can someone explain me the concept of Copy book?

Quite simply: a copybook is a member of a library (PDS, PDSE, etc.) containing source code (usually, but by no means exclusively, data declarations) which is included by some mechanism at the compiler or librarian level in another source module. The advantage of using copybooks is that a single copybook can be included in a multiplicity of modules; thus, if the copybook represents, e.g., a record format used by many programs and that format changes, the source for it need be changed only once and the many programs will pick up the changes upon re-compilation (indeed, some source management systems will automatically re-compile all programs using a copybook when it is changed). Similar features are to be found in most languages.
"You have sat too long for any good you have been doing lately ... Depart, I say; and let us have done with you. In the name of God, go!" -- what I say to a junior programmer at least once a day
User avatar
Akatsukami
Global moderator
 
Posts: 1058
Joined: Sat Oct 16, 2010 2:31 am
Location: Bloomington, IL
Has thanked: 6 times
Been thanked: 51 times


Return to IBM Cobol

 


  • Related topics
    Replies
    Views
    Last post