To do this manually, If you have "B1234" (each character taking 1 byte) then the "manual" conversion would be (4 * (16 ** 0)) + (3 * (16 ** 1)) + (2 * (16 ** 2)) + (1 * (16 ** 3)) + (11 * (16 ** 4)
You would need to first convert A to 10, B to 11 ... F to 16 "Srini" <[EMAIL PROTECTED]> wrote in message news:<[EMAIL PROTECTED]>... > Thanks a lot for reply. Yes. I am receiving the data as PIC X(5) with > HEX values in it like "B1234". Do you have any example of this > conversion?. What is "manual" base-16 to base-10 conversions? > > Appreciate your help. > > Srini > > On Dec 17, 10:45 am, [EMAIL PROTECTED] (Bill Klein) wrote: > > When you say > > 5 character HEX value > > > > Do you mean something like PIC X(10) with values of "A12F33FFdd" - or do you > > mean that you are actually receiving data in "binary" which you are > > considering "hex"? If it is something like the first example, then the > > most common way to "solve" this in COBOL is by creating a 256 byte table and > > of hex bytes - and then do a SEARCH ALL to convert from the location in the > > table to the decimal value of that single hex-byte-value. Other methods do > > "manual" base-16 to base-10 conversions. > > > > "Srini" <[EMAIL PROTECTED]> wrote in message > > > > <news:[EMAIL PROTECTED]>... > > > > > I am receiving 5 character HEX value from a file and the requirement > > > is to convert the 5 character HEX value to Decimal in a COBOL program. > > > Is there any function/verb available in COBOL to convert the HEX vale > > > to Decimal? > > > > > Thanks in advance. > > ---------------------------------------------------------------------- For IBM-MAIN subscribe / signoff / archive access instructions, send email to [EMAIL PROTECTED] with the message: GET IBM-MAIN INFO Search the archives at http://bama.ua.edu/archives/ibm-main.html