REGISTER or login:
Do you want to do this with RPG, CL, SQL, COBOL???
I'll assume RPG. Is your input file externally defined or are you using "I" specs? If you are using "I" specs, you can just specify starting and ending positions for different fields on the report.
If you are not using "I" specs, create a DS with the same length as you single input field and then create subfields the same as describe above.,
I should have mentioned that you can create a PF with the fields all defined from your report and then do a CPYF FMTOPT(*NOCHK). You would also want to use the INCCHAR option to select only specific records.
" I’m not familiar with any programming language in AS400 so I can only use CL. "
Don't believe that you don't know a programming language -- CL certainly qualifies as a quite good programming language. Especially if your system is reasonably current (V5R4 or higher).
In a CL program, you'd use DCLF to declare the file. The program would use RCVF to read each record in a loop.
After the RCVF, the program could call the QCLSCAN API to scan variable strings for substrings. (If you have i 7.1, you can use the new %SCAN() built-in function that was added by PTF SI49061.)
At V5R4 and later, you might use the strstr() C library function. In many cases, that can be simpler that calling QCLSCAN.
However, it can depend on what you want to accomplish. For example, if you want to print a list of records that have that substring, you might just run the FNDSTRPDM or the FNDSTRPDM2 command. If you tell us what you need to do, we might have better ideas.
It might be best to copy the spooled file into a streamfile and use QShell utilities. CL can call QShell functions in a couple different ways. Or a REXX procedure might also be better.
CL certainly qualifies as a quite good programming language.
I fully and enthusiastically agree (even before V5R3/V5R4), though I've almost given up trying to convince many others. Since V5R4, it's almost a dream come true. (And if I could just figure a way to use QleGetExp...)