What is the point of the REPLACING option of a copy statement?

REPLACING allows for the same copy to be used more than once in the same code by changing the replace value

Showing Answers 1 - 2 of 2 Answers

SreeHari

  • Nov 15th, 2005
 

Hi,

COPY AR00RB REPLACING ==:AR00:== BY ==AMBS==.

AR00RB COPY BOOK AS FOLLOWS AS (iam copying only few lines of code)

01 :AR00:RB-WORK-AREA

   03 :AR00:RB-IO-REQUEST PIC S9(04)       BINARY
                                        VALUE ZERO
    88 :AR00:RB-OPEN-INPUT              VALUE +01.
    88 :AR00:RB-OPEN-OUTPUT             VALUE +02.
    88 :AR00:RB-OPEN-IO                 VALUE +03.
    88 :AR00:RB-OPEN-INPUT-DYN          VALUE +04.
    88 :AR00:RB-OPEN-OUTPUT-DYN         VALUE +05.
    88 :AR00:RB-OPEN-IO-DYN             VALUE +06.
    88 :AR00:RB-OPEN-INPUT-RDM          VALUE +07.
    88 :AR00:RB-OPEN-OUTPUT-RDM         VALUE +08.
    88 :AR00:RB-OPEN-IO-RDM             VALUE +09.
    88 :AR00:RB-START-GTE               VALUE +10.

Here that copy statement replace with AMBS in place :AR00:

So this routine is usefull for all files to open, read, write, close, delte etc.

Regards,

Hari


 

  Was this answer useful?  Yes

Hi,

   Replacing option in COPY verb provides facility to use same block of code for different programs having all things common except few variables in that particular block of code. It providesdes the feature of reusablity without writing it again and again.

regards

pbhatt

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions