+ Reply to Thread
Page 1 of 2 1 2 LastLast
Results 1 to 10 of 15

Thread: Hex to Character Conversion Revisited

  1. #1
    Guest.Visitor Guest

    Default Hex to Character Conversion Revisited

    ** This thread discusses the article: Hex to Character Conversion Revisited **
    When converting from char to hex, the source length should be twice the Char input length, not the Char input length. Jim

  2. #2
    Guest.Visitor Guest

    Default Hex to Character Conversion Revisited

    ** This thread discusses the article: Hex to Character Conversion Revisited **
    In the article you state: cvthc converts from character value to hexadecimal text (that is, from 'A' to X'C1'). I feel that this may be incorrect. 'A' is the same as x'C1' Is it not correct to state: ... (that is, from 'A' to x'FCF1' or 'C1')

  3. #3
    Guest.Visitor Guest

    Default Hex to Character Conversion Revisited

    ** This thread discusses the article: Hex to Character Conversion Revisited **
    I have a need to convert EBCDIC characters to ASCII Hex (A123 = x'41313233'). Can these routines convert among CCSID's? Any other way to do this other than Select/When?

  4. #4
    Guest.Visitor Guest

    Default Hex to Character Conversion Revisited

    ** This thread discusses the article: Hex to Character Conversion Revisited **
    Thanks Bob. The cvtch and cvthc functions only work on 0-9, A-F. I need to be able to convert the entire character set, including non-alphanumeric characters (i.e. "-/.#" etc.). Any suggestions?

  5. #5
    P.Harkins Guest

    Default Hex to Character Conversion Revisited

    ** This thread discusses the article: Hex to Character Conversion Revisited **
    Bob, Thanks very much, yet again, for this valuable technique. I would like to utilize it now in my auditing. Could you please give a example of the Calc specs used to perform this conversion? I need to take any variable and convert it, as in a program dump which shows both Character and Hexidecimal for the variable. Many, many Thanks, Paul H. Harkins

  6. #6

    Default Hex to Character Conversion Revisited

    ** This thread discusses the article: Hex to Character Conversion Revisited **
    Bob, how can I specify a codepage (CCSID) there ? I ask because different codepages mean different characters. For example the hex value X'7C' means in codepage 1141 the value "§" and in codepage 1153 the value "@". BR, Konni

  7. #7

    Default Hex to Character Conversion Revisited

    ** This thread discusses the article: Hex to Character Conversion Revisited **
    The meaning of the data doesn't matter to the API. If you have a byte with the value x'7C', the toHex function will give '7C', no matter how x'7C' might appear if you display it.

  8. #8

    Default Hex to Character Conversion Revisited

    ** This thread discusses the article: Hex to Character Conversion Revisited **
    Simple example attached...
    Code

  9. #9
    P.Harkins Guest

    Default Hex to Character Conversion Revisited

    ** This thread discusses the article: Hex to Character Conversion Revisited **
    Phil, Many thanks for the complete example. The convert to and from Hex routines would make great BIFs for IBM in RPGLE. Best Regards, Paul H. Harkins

  10. #10
    Guest.Visitor Guest

    Default Hex to Character Conversion Revisited

    ** This thread discusses the article: Hex to Character Conversion Revisited **
    I am trying to go from a 128 hex field to a 64 character field. I assume I would only need part of the code you offered (see below)? What I don't understand is how the fields: szCharVal, szHexVal, nSrcLen and len, inCharVal, ouCharVal, inHexVal, ouHexVal relate to each other? What field would I plug in the 128 hex field and what field would return the 64 character field? THank you.
    Code

+ Reply to Thread
Page 1 of 2 1 2 LastLast

Similar Threads

  1. QDCXLATE character conversion
    By Guest.Visitor in forum IBM
    Replies: 0
    Last Post: 03-06-2006, 02:30 PM
  2. Character conversion
    By Guest.Visitor in forum RPG
    Replies: 6
    Last Post: 05-21-2003, 09:43 AM
  3. CHECK CHARACTER FIELD ON PRESENCE OF CHARACTER
    By Guest.Visitor in forum SQL
    Replies: 4
    Last Post: 03-26-2002, 04:27 AM
  4. Incorrect character set conversion
    By Guest.Visitor in forum Programming
    Replies: 4
    Last Post: 06-18-2001, 09:26 AM
  5. Character to Decimal conversion errors via CEE4JSTN
    By Guest.Visitor in forum Programming
    Replies: 4
    Last Post: 07-26-2000, 10:05 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts