Thanks enrico. I've downloaded it.
However, this topic started as an interview question on Cobol. I'm not sure the interviewer would be so happy with "I'd use Galili-Giancarlo and write it in C" as an anwer. Maybe they would. Shows initiative, broader knowledge not only of languages, but research and more complex algorithms than mostly you'd find in Cobol. If I was the interviewer, I'd certainly ask, after the candidates more exact explanation, "yes, but I'd like to know how you'd approach it in Cobol".
What I have tried to show is how I used to do substrings in Cobol. I first did this before UNSTRING was available, and before LE (and without access to C/C++, PL/X'0001' or FORTRAN) and without wanting to do it in Assembler (although thinking about it it would not be as bad as all that).
Would I use the technique today? Yes, to produce a result. Would I also find time to look for a more "modern" alternative? I'd like the think so.
I like the idea, to an extent, of calling Rexx from Cobol. Is this really possible (doesn't seem to mention it in LE)? To another extent, I also don't like the idea, if it is possible.