I have a requirement and i wanted to know if anyone has any suggestions on how to go about it.
I have to search for a hex value (X'5F') in position (2,19). (there can be multiple occurences of this value, we've to process them all)
If this is found, I have to look at the next column hexadecimal value (it will be number, for ex x'10'). This number tells us how many SPACES are to be introduced.
So,
I have to replace
>(X'5F10') by 10 SPACES.
>(X'5F04') by 4 SPACES.
>(X'5F19') by 19 SPACES.
EXAMPLE:
Input record:
----+----1----+----2
DBERG¬.10206¬.OVER C
CCCDC51FFFFF50DECD4C
42597F010206F4655903
DBERG¬.10206¬.OVER C
CCCDC51FFFFF50DECD4C
42597F010206F4655903
The output will be
---+----1----+----2----+----3-
DBERG 10206 OVER C
CCCDC4444444444FFFFF4444DECD4C
425970000000000102060000655903
DBERG 10206 OVER C
CCCDC4444444444FFFFF4444DECD4C
425970000000000102060000655903
Note : Along with this I had some 30 different conditions, which I was able to code with ICETOOL.
So if there are more than one ways to do it, I'd prefer ICETOOL
Thanks for your help in advance.