Logo 
Search:

Cobol Articles

Submit Article
Home » Articles » Cobol » Homework HelpRSS Feeds

PROGRAM TO FIND THE UNSTRING WORD

Posted By: Nixie Schmidt     Category: Cobol     Views: 5390

PROGRAM TO FIND THE UNSTRING WORD.

* = MISS.
# = MRS.
$ = MR.
/ = FATHER'S NAME
^ = HUSBAND ANME

Code for PROGRAM TO FIND THE UNSTRING WORD in Cobol

       IDENTIFICATION DIVISION.
       PROGRAM-ID. PROGFF.

       ENVIRONMENT DIVISION.

       DATA DIVISION.
       WORKING-STORAGE SECTION.

       77 NAM PIC A(50).
       77 C1 PIC A(50).
       77 C2 PIC A(50).
       77 C3 PIC A(50).
       77 DEL1 PIC A(10).
       77 DEL2 PIC A(10).

       PROCEDURE DIVISION.
       MAIN-PARA.

            ACCEPT NAM.
            UNSTRING NAM DELIMITED BY "*" OR "#" OR "$" OR "/" OR "^"
                INTO C1 DELIMITER IN DEL1,
                     C2 DELIMITER IN DEL2,
                     C3.
                IF DEL1 EQUAL "*"
                        DISPLAY " MISS " C1 C3
                ELSE IF DEL1 EQUAL "#"
                        DISPLAY " MRS " C1 C3
                ELSE IF DEL1 EQUAL "$"
                        DISPLAY " MR " C1 C3
                ELSE
                        DISPLAY " INVALID INPUT ".
                IF DEL2 EQUAL "/"
                        DISPLAY " FATHER'S NAME : " C2 C3
                ELSE IF DEL2 EQUAL "^"
                        DISPLAY " HUSBAND'S NAME : " C2 C3
                ELSE
                        DISPLAY " INVALID INPUT ".
                STOP RUN.        

  
Share: 

 
 

Didn't find what you were looking for? Find more on PROGRAM TO FIND THE UNSTRING WORD Or get search suggestion and latest updates.

Nixie Schmidt
Nixie Schmidt author of PROGRAM TO FIND THE UNSTRING WORD is from Frankfurt, Germany.
 
View All Articles

Related Articles and Code:


 
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!