I would like to retrieve records that contains a specified keyword that will be found any where in the record. I would like to retrieve the only the part of the record that starts after it encounters the keyword till the position where it encounters first encounters a colon .
Below are the details of the file. RECFM =FB , LRECL=1000.
Input file:-
12345678901234...ABC:345RSS567890...:XYZ:7634843..:DEF:893795...
01234567...ABC:763AUD64748909...:PQR:79395:GEF:789387593...
1234567890123456789234...ABC:345CAD567890...:XYZ:763..:MNO:893795...
212345679638645...ABC:763YEN6474890945456665...:BED:793956893...:JKL:7893...
The keyword specified here is "ABC:" and it can start any where in the record. I would like to extract only the part of record that has tag "ABC:" i.e. starting after we encounter the keyword "ABC:" till the time where it encounters the first colon ":" as shown below.
Output file:-
The entire ABC tag.
345RSS567890...
763AUD64748909...
345CAD567890...
763YEN6474890945456665...
I tried exploring the other ways but couldn't progress mush as i'm unaware of how we can get only the specific part of the record dynamically.
Below was the piece of code i just started and couldn't progress much.
SORT FIELDS=COPY
INCLUDE COND=(1,1000,SS,EQ,C"ABC:")
Can someone please help me in getting it resolved?
Thanks in advance