Hi Claude,
It's SUPPOSED to take a string in the I/P rec and determine if it should be moved to an O/P field. If it is to be moved, move it to the next available spot in the O/P rec.
The 2000-... rtn scans the I/P fld and calcs the len of the next string. If it s/b moved a flag is set to "must-move-fld". This rtn is not shown. Upon return from this rtn the length of the string (len) is used in the mod refed move stmt and also used to bump the position ptr(s), s-pos & r-pos, where necessary.
so, if an I/P fld looked like:
maaa mcccccccccc dddddd me mfffffffffffffffffff ggg
and only the strings beginning w/m were to be moved, the O/P fld looks like:
maaamccccccccccmemffffffffffffffffffff
I didn't count the chars, so they may be off by 1 or 2.
Now this can be accomplished by other means, but it IS an example of using variables in a ref mod stmt. Also I may not have initialized flds, etc. For example, s-pos s/b also bumped by +1 to account for the space. Remember I'm making up both sides of this as I go along; but it should give you an idea.
Regards, Jack.