Page 1 of 1

Need to replcae hexadecimal value in FB format file

Posted: Wed Jan 18, 2012 8:48 pm
by anilanju
Hi

I need to sort a file, replacing the special char to spaces.
i am using
OPTION COPY
INREC FINDREP=(IN=(C'/',C'.',C'..'),
OUT=C' ',STARTPOS=11,ENDPOS=120)

Now i need to replace a hexadecimal value in the same file from 41 to 40. at any position in the file.
How do i do that.
i tried using this
OPTION COPY
INREC FINDREP=(IN=(C'/',C'.',C'..'PD'41'),
OUT=(C' ',PD'40'),STARTPOS=11,ENDPOS=120)


Can someone help please

Posted: Wed Jan 18, 2012 10:25 pm
by Frank Yaeger
It's not at all clear what you mean by
Now i need to replace a hexadecimal value in the same file from 41 to 40. at any position in the file.
What are PD'41' and PD'40' supposed to represent? If you mean packed values of 41 and 40, that would be X'041C' and X'040C' and you could use those hex values for IN and OUT.

If you mean X'41' and X'40', you can use those values for IN and OUT (note that X'40' = C' ').

Or do you want to do something else? If something else, please explain clearly what you want to do and show the input and output values in hex.

Please show the input and output values in hexadecimal and indicate the positions in which you want to do the find/replace.

Posted: Thu Jan 19, 2012 4:54 pm
by anilanju
Hi

Thanks it workied. I used X'41' in Input and used c' ' in out.
worked fine

Thanks