Skip to Main Content
PROGRAMMING IN COBOL/400: 2nd Edition
book

PROGRAMMING IN COBOL/400: 2nd Edition

by James Cooper, Nancy Stern, Robert A. Stern
January 2002
Intermediate to advanced content levelIntermediate to advanced
736 pages
18h 57m
English
Wiley
Content preview from PROGRAMMING IN COBOL/400: 2nd Edition

Chapter 10. THE COPY AND CALL STATEMENTS

CHAPTER OBJECTIVES

Upon completion of this chapter, you should be able to

  • Explain the purpose of the COPY statement and describe its use.

  • Demonstrate the COPY statement for copying a source member into a program.

  • Explain the purpose of the CALL statement and describe its use.

  • Demonstrate how the CALL statement is used for dynamic and static program calls.

THE COPY STATEMENT

The COPY statement is used to bring into a program a source member consisting of a series of prewritten COBOL statements. The COBOL source member is copied from a source file that is stored in a library. Copying a source member, rather than coding the statements directly in the program, has the following benefits: (1) it saves a software developer a considerable amount of coding and debugging time; (2) it promotes program standardization since all programs that use the source member will be using common data-names and/or procedures; (3) it reduces the time it takes to make modifications and reduces duplication of effort; if a change needs to be made to the code, it can be made just once in the source member without the need to alter individual programs; and (4) source members are extensively annotated so that they are meaningful to all users; this annotation results in better-documented programs and systems.

Most often, the COPY statement is used to copy FD and 01 entries that define and describe files and records. In addition, standard modules to be used in the PROCEDURE DIVISION ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Designing and Programming CICS Applications

Designing and Programming CICS Applications

John Horswill, Members of the CICS Development Team at IBM Hursley

Publisher Resources

ISBN: 9780471418467Purchase book