Logo 
Search:

Cobol Articles

Submit Article
Home » Articles » Cobol » Homework HelpRSS Feeds

Program that Includes an external source file in the current source file

Posted By: Adalia Fischer     Category: Cobol     Views: 1702

Program that Includes an external source file in the current source file.

Code for Program that Includes an external source file in the current source file in Cobol

* =================================================================
*  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
  
Share: 



Adalia Fischer
Adalia Fischer author of Program that Includes an external source file in the current source file is from Frankfurt, Germany.
 
View All Articles

 
Please enter your Comment

  • Comment should be atleast 30 Characters.
  • Please put code inside [Code] your code [/Code].

 
No Comment Found, Be the First to post comment!