IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

What does a COPYBOOK exactly do and how it is used


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
devonline

New User


Joined: 14 Jun 2005
Posts: 2

PostPosted: Tue Jun 14, 2005 12:29 pm
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
Sangita

New User


Joined: 02 Jun 2005
Posts: 17

PostPosted: Tue Jun 14, 2005 12:52 pm
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

New User


Joined: 23 May 2005
Posts: 97
Location: Chennai

PostPosted: Thu Jun 16, 2005 3:16 pm
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
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts REXX code to expand copybook in a cob... CLIST & REXX 2
No new posts Trying to change copybook in online c... CICS 4
No new posts Help to Filter File Manager Copybook ... DFSORT/ICETOOL 14
No new posts Need to add field to copybook, proble... COBOL Programming 14
No new posts Recompiling programs after a copybook... COBOL Programming 1
Search our Forums:

Back to Top