Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Put hexadecimal data into numeric field

Status
Not open for further replies.

francoisf

Programmer
Feb 11, 2004
30
FR
Hello,
i've to read hexadecimal data (i suppose because i can't read it using WRKQRY or DSPPFM).
Those data should be numeric data.
How can i read it by RPG program ?
Thank you !
 
You can convert it to charcter first, and then move it to a numeric field.

You need to use a C-runtime function, 'cvtch', and to do that, be sure you put the following in your H-specs:

H BNDDIR('QC2LE')

Here is an example:


Good luck.


"When once you have tasted flight, you will forever walk the Earth with your eyes turned skyward, for here you have been, and there you will always long to return."

--Leonardo da Vinci
 
Well if the dds of the file has it defined as hex,,, then the program will "read" it correctly. So will the wrkqry function.
 
By the way, I apologize for the unweildy link to Google News. Not long ago, Tech-Tips shortened the link which appears in the post with ellipses (...) - now, URL's fon't even have a hyperlink!

If you do a Google search in newsgroups with the following arguments

'cvtch' qc2le

the second thread is the same one I was referring to before.


"When once you have tasted flight, you will forever walk the Earth with your eyes turned skyward, for here you have been, and there you will always long to return."

--Leonardo da Vinci

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top