Logo 
Search:

Cobol Articles

Submit Article
Home » Articles » Cobol » Homework HelpRSS Feeds

PROGRAM TO FIND AND REPLACE USING INSPECT VERB

Posted By: Christopher Brown     Category: Cobol     Views: 9049

PROGRAM TO FIND AND REPLACE USING INSPECT VERB

Code for PROGRAM TO FIND AND REPLACE USING INSPECT VERB in Cobol

IDENTIFICATION DIVISION.
     PROGRAM-ID. INSPECT-VERB.

    DATA DIVISION.
     WORKING-STORAGE SECTION.
      01 REC PIC X(80).
      01 SEARCH-WORD PIC XXX.
      01 REPLACE-WORD PIC XXX.

       PROCEDURE DIVISION.
       DISPLAY "ENTER THE SENTENCE..".
       ACCEPT REC.
       DISPLAY "ENTER THE WORD TO BE SEARCHED..".
       ACCEPT SEARCH-WORD.
       DISPLAY "ENTER THE WORD TO BE REPLACES..".
       ACCEPT REPLACE-WORD.
       INSPECT REC REPLACING ALL SEARCH-WORD BY REPLACE-WORD.
       DISPLAY REC.
       STOP-RUN.

/*******************************************************************************************
OUTPUT
********************************************************************************************/
ENTER THE SENTENCE.. HI ENTER THE WORD TO BE SEARCHED.. I ENTER THE WORD TO BE REPLACES.. H HH
  
Share: 


Didn't find what you were looking for? Find more on PROGRAM TO FIND AND REPLACE USING INSPECT VERB Or get search suggestion and latest updates.

Christopher Brown
Christopher Brown author of PROGRAM TO FIND AND REPLACE USING INSPECT VERB is from London, United Kingdom.
 
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!