Page 1 of 1

Convert from EBCDIC to HEX

PostPosted: Mon Mar 28, 2016 6:13 pm
by rsrn333
is there a way to convert from EBCDIC to HEX?

this is to be used in AFP file which is in HEX format.

we have to add a value to the BNG records in AFP(which denotes a start of a transaction in a file).

to do that we are running a counter variable (in decimal format) each time the BNG record is encountered in the AFP fule. from here we need to take the generated value as an EBCDIC code and convert it to its equivalent HEX code. EX:

EBCDIC     HEX
0          F0
1          F1
2          F2
etc...

the HEX values have to be populated into the AFP file.
Coded

Re: Convert from EBCDIC to HEX

PostPosted: Mon Mar 28, 2016 6:34 pm
by Robert Sample
Are you saying you want the 1-character value 0 to be replaced by the 2-character value F0? Because EBCDIC is already in hexadecimal (which is just a shortcut to refer to binary values which means ASCII can be considered hexadecimal as can UTF-8, UTF-16, etc), so your post doesn't make sense otherwise.

Re: Convert from EBCDIC to HEX

PostPosted: Mon Mar 28, 2016 6:57 pm
by Terry Heinze
rsrn333,
In the future, please use code tags to preserve correct spacing.