Dick, Yes, I have to used 9(03) if I have to run for 165 occurances. But my sample code has just 3 occurances, so 9(02) can very well accomodate it. Do you still find some errors in my code? I tested my code for all possibility and it is working good.
William Thompson, I asked for the exact code not because I don't know how to build on the logic given by CG, but because I have a few concerns.
CICS Guy, First of all it is not my requirement!! I invited myself just to solve the problem.
If we have input like
_First_Line_
_Second_Line_
Output of the code will have
But it should have been
'_' denotes spaces.
Anyway, thank you all guys, Arun.
