Portal | IBM Manuals | Downloads | Products | Refer | Info | Programs | JCLs | Forum Rules*| Site Map | Mainframe CD 
IBMMAINFRAMES.com - IBM Mainframe Support Forums Index
 
Register
 
IBMMAINFRAMES.com - IBM Mainframe Support Forums Index FAQ Search Memberlist Usergroups Profile Log in to check your private messages Log in
 
What does a COPYBOOK exactly do and how it is used

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> Mainframe COBOL
Author Message
devonline
Warnings : 2

New User


Joined: 14 Jun 2005
Posts: 2

PostPosted: Tue Jun 14, 2005 12:29 pm    Post subject: What does a COPYBOOK exactly do and how it is used
Reply with quote

Hi Friends,

Can anyone tell me what does a copy book exactly does and how is it used?
Back to top
View user's profile Send private message
References
Sangita

New User


Joined: 02 Jun 2005
Posts: 13

PostPosted: Tue Jun 14, 2005 12:52 pm    Post subject: Re: Copybooks
Reply with quote

Hi devonline,

In most of the big applications , there are large no. of programs
and maximum of them use a particular record structures and routines such as date validation routines are generally used by several programs.In such cases its important to ensure that each program has the same file description, record structure or code. And maintaining several copies of the same thing leads to errors and also time consuming.
Each time you modify one copy , you also modify all tha other copies. So to avoid all these we use COPYBOOK. The COPY statement inserts the copybook from the copylibrary into the source program during compilation.

e.g. COPY copybook-name OF/IN copy library-name

REPLACING identifier-1 BY identifire-2


1. COPY STUDREC.
2. COPY STUDREC REPLACING ALL "XX" BY "YY".

Regards,
Sangita
Back to top
View user's profile Send private message
sudheer648

Active User


Joined: 23 May 2005
Posts: 97
Location: Chennai

PostPosted: Thu Jun 16, 2005 3:16 pm    Post subject: Re: What does a COPYBOOK exactly do and how it is used
Reply with quote

Hi devonline,

Copy Book Usage is to reduce the Redundancy of the similar declaritons/structure/etc.,

As Sangita use the Copy <copybookname> to include that copybook into your program while compilation.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> Mainframe COBOL All times are GMT + 6 Hours
Page 1 of 1