I need to read a file using RPGLE and then display the Hexadecimal value of some of the fields of the file in a display file.
Can someone tell me how to get the hex value of a field in a rpgle program and display it in a display file.
Any suggestions will be really appreciated
RPG IV doesn't have any built in HEX() function...
However, SQL does.
Optionally, you can use the MI Convert Hex to Character (CVTHC)* instruction using a prototype like so...
*Note the MI name(s) are counter-intuitive, the reverse operation is
Convert Character to Hex (CVTCH).
Here's a good article by Jon Paris, Practicing Safe Hex in RPG, about the MI functions.