Page 1 of 1

Copy Book

PostPosted: Tue Nov 15, 2011 1:55 am
by Sanket
Can someone explain me the concept of Copy book?

Re: Copy Book

PostPosted: Tue Nov 15, 2011 2:16 am
by dick scherrer
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.

Re: Copy Book

PostPosted: Tue Nov 15, 2011 2:23 am
by Akatsukami
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.