GeekInterview.com
  I am new, Sign me up!
 
GeekInterview.com  >  Interview Questions  >  Mainframe  >  COBOL
Go To First  |  Previous Question  |  Next Question 
 COBOL  |  Question 98 of 162    Print  
How do you make the conversion from ascii to hex in cobol ? is there any function which will do this in cobol?

  
Total Answers and Comments: 3 Last Update: September 01, 2008     Asked by: sandeep851985 
  
 Sponsored Links

 
 Best Rated Answer

No best answer available. Please pick the good answer available or submit your answer.
March 18, 2007 16:22:50   #1  
sarah        

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

 
Is this answer useful? Yes | No
July 06, 2007 04:46:44   #2  
shriniv Member Since: June 2007   Contribution: 10    

RE: How do you make the conversion from ascii to hex i...
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.

***

 
Is this answer useful? Yes | No
September 01, 2008 06:42:44   #3  
prasenjit_in Member Since: April 2008   Contribution: 18    

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

You can also do this using DFSORT....

OUTREC FILEDS (20 7 BI TO PD)


 
Is this answer useful? Yes | No


 
Go To Top


 Sponsored Links

 
About Us -  Privacy Policy -  Terms and Conditions -  Contact -  Ask Question -  Propose Category -  Site Updates 

Copyright © 2005 - 2009 GeekInterview.com. All Rights Reserved

Page copy protected against web site content infringement by Copyscape