Can someone please help in finding out the position where the phrase is encountered in the text.
for examle : Mainframe Forum is very useful for programming.
Here i need to know the position where the word programming is appeared. This word can occur at different position dynamically based on the input text.
01 MATCH-STATUS PIC X(1) VALUE 'N'.
88 NO-MATCH VALUE 'N'.
88 MATCH-FOUND VALUE 'Y'.
PERFORM UNTIL Z = LENGTH OF A OR MATCH-FOUND
COMPUTE Z = Z + 1
IF A(Z:11) = 'PROGRAMMING'
SET MATCH-FOUND TO TRUE
MOVE Z TO K
END-IF
END-PERFORM
DISPLAY " VALUE OF K :" K
Is there any way we can do the same logic with INSPECT or STRING / UNSTRING command.. I'm trying out with UNSTRING WITH POINTER but it seems doesnt working.