cobolCOPY directive


The COBOL version of the C #include preprocessor directive. Or, more historically accurate, COBOL came first, developed some 10 years earlier.

Due to some of the design decisions in COBOL (no arguments for PERFORM as the primary reason), many data structure access sequences need to break the DRY principle. Names of structure components need to be repeated in the ENVIRONMENT DIVISION, the DATA DIVISION and possibly many times in the PROCEDURE DIVISION. This is usually handled by adding copybooks. Record declarations and access code are tucked away in separate files and the COPY statement is the only repeated source. A change to the copybook keeps all uses of name spelling and data layout in synch, instead of requiring multiple edits to multiple files when a change occurs.

enter image description here