*   locate each of the characters in the yString.  Then use the INSPECT to
*   find the position of each in the xString.  Return whichever is the least.
    MOVE "fred" TO yStr
    MOVE 51 TO EndCount
    PERFORM VARYING CharPos FROM 1 BY 1 UNTIL CharPos > 4
       MOVE 1 TO CharCount
       INSPECT xStr TALLYING CharCount FOR CHARACTERS
            BEFORE INITIAL yStr(CharPos:1)
       IF CharCount < EndCount MOVE CharCount TO EndCount
       END-IF
    END-PERFORM
    DISPLAY "Task7 First occur