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.