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".