I was trying to find a string in the members of a PDS and did that using below:
REXX:
PUSH INP
MAC = FINDMAC
ADDRESS ISPEXEC "VIEW DATASET('"FILE_NAME"') MACRO("MAC")"
IF RC = 0 THEN
DO
PULL FINDS
FINDCNT.STRC = FINDS
END
MAC = FINDMAC
ADDRESS ISPEXEC "VIEW DATASET('"FILE_NAME"') MACRO("MAC")"
IF RC = 0 THEN
DO
PULL FINDS
FINDCNT.STRC = FINDS
END
MACRO:
ADDRESS ISREDIT
"MACRO"
"RES"
PULL INP
STR = "'"||STRIP(INP)"'"
ISREDIT FIND STR ALL
"(FINDS) = FIND_COUNTS"
PUSH FINDS
"ISREDIT END"
"MACRO"
"RES"
PULL INP
STR = "'"||STRIP(INP)"'"
ISREDIT FIND STR ALL
"(FINDS) = FIND_COUNTS"
PUSH FINDS
"ISREDIT END"
Occurrence count is coming fine.
Now my requirement is to get the line number where string is found and the line itself i.e. the report displaying the line number and full line text where the string is found.
Any suggestions how to extract these details?