Page 1 of 1

How to replace the low HEX values

PostPosted: Mon May 31, 2010 11:34 pm
by Irene Ioujanina
Good afternoon, everyone,
Hope you're all well.

May I please ask again.

I have a file that could include low hex valuess (hex'00' or hex'05' or hex'02') in many places.

I'm using the following to replace them to 'valid' characters:
//TOOLIN DD *
COPY FROM(DD1) TO(DD2) USING(CVT1)
//CVT1CNTL DD *
ALTSEQ CODE=(05C5,0040,02C1)
OUTFIL FNAMES=(DD2),
OUTREC=(1,27500,TRAN=ALTSEQ)
/*
,which replaces
05-> to C5 (char 'E')
00 -> to 40 (char space)
02 -> to C1 (char 'A')

Now I have a more difficult task to replace not only the character found, but any character BEFORE it.

For instance there is a following string : 'ACCEPTC.S'
123456789
----------
ACCEPTC.S<
CCCCDEC0E4
133573352C
----------
I need to replace the 8th position hex'05' to hex'C5' (char 'E') and delete teh hex'C3' in the 7th position, creating the string:
'ACCEPTES'

Thanking you in advance,
Irene

Re: How to replace the low HEX values

PostPosted: Tue Jun 01, 2010 10:57 pm
by Frank Yaeger
I can't think of a practical way to do that with DFSORT. I'd suggest you write a program or exit with the appropriate logic to do it.

Re: How to replace the low HEX values

PostPosted: Tue Jun 01, 2010 11:10 pm
by Irene Ioujanina
Thank you.
:)