Program that Includes an external source file in the current source file.
* ================================================================= * TEST.INC DISPLAY "Hello" DISPLAY "NUM1=" NUM1 * ================================================================= * ================================================================= IDENTIFICATION DIVISION. PROGRAM-ID. TEST_COPY. DATA DIVISION. WORKING-STORAGE SECTION. 77 STR PIC X(20). 77 NUM1 PIC 9(5). 77 NUM2 PIC 9(5). PROCEDURE DIVISION. MAIN. MOVE 1111 TO NUM1 MOVE 22 TO NUM2 MOVE "ABC" TO STR DISPLAY "In english" COPY "TEST.INC" DISPLAY "" DISPLAY "En francais" COPY "TEST.INC" REPLACING NUM1 BY NUM2 "Hello" BY "Bonjour" DISPLAY "" DISPLAY "Auf Deutsch" COPY "TEST.INC" REPLACING "Hello" BY "Gutentag" NUM1 BY STR STOP RUN . * ================================================================= * Result: * In english * Hello * NUM1=01111 * * En francais * Bonjour * NUM1=00022 * * Auf Deutsch * Gutentag * NUM1=ABC