How do you make the conversion from ascii to hex in cobol ? is there any function which will do this in cobol?

Questions by sandeep851985

Showing Answers 1 - 9 of 9 Answers

sarah

  • Mar 18th, 2007
 

My question is about making a conversion from a number to hex
                                                                                                thanks.

  Was this answer useful?  Yes

shriniv

  • Jul 6th, 2007
 

If you are referring conversion of COMP-3 values to decimals, here is the logic. The same can be altered to do the reverse.
1. Find the ascii value of the first character of the COMP-3 field.
2. Divide the value by 16 and store the quotient in a variable. (string)
3. If the remainder is > 0 then concatenate it with the string above.
4. Repeat the steps till you read all the characters of the comp-3 field (or) quotient is zero (or) ascii value is 12.

***

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions