=?utf-8?B?SW4gZ29lcyBhIGJpbmFyeSBzdHJpbmcgJ8Obw7YR4oCiAe KAsMK4w4vCt10nIGFuZCBvdXQgY29tZXMgSEVYICdEQkY2MTE5 NTAxODlCOENCQjc1RCcu?= - IBM AS400

This is a discussion on =?utf-8?B?SW4gZ29lcyBhIGJpbmFyeSBzdHJpbmcgJ8Obw7YR4oCiAe KAsMK4w4vCt10nIGFuZCBvdXQgY29tZXMgSEVYICdEQkY2MTE5 NTAxODlCOENCQjc1RCcu?= - IBM AS400 ; Hi, I know the easiest way to convert chars c '1234' to hex c 'C1C2C3C4' is using the CVTCH MI function and this is exactly what I want and it works fine in my RPG pgm. The problem is here: ...

+ Reply to Thread
Results 1 to 4 of 4

Thread: =?utf-8?B?SW4gZ29lcyBhIGJpbmFyeSBzdHJpbmcgJ8Obw7YR4oCiAe KAsMK4w4vCt10nIGFuZCBvdXQgY29tZXMgSEVYICdEQkY2MTE5 NTAxODlCOENCQjc1RCcu?=

  1. =?utf-8?B?SW4gZ29lcyBhIGJpbmFyeSBzdHJpbmcgJ8Obw7YR4oCiAe KAsMK4w4vCt10nIGFuZCBvdXQgY29tZXMgSEVYICdEQkY2MTE5 NTAxODlCOENCQjc1RCcu?=

    Hi,
    I know the easiest way to convert chars c '1234' to hex c 'C1C2C3C4'
    is using the CVTCH MI function and this is exactly what I want and it
    works fine in my RPG pgm.

    The problem is here:
    Using an API 'Qc3EncryptData' which ecnrypts data, I receive a char-
    string which looks like x'DBF6' (presented as 'Ûö') and so on in
    wrkdbf (F8). As soon as I send this (part of a) string to CVTCH I get
    a strange error like MCH3601 Pointer not set for location reference.
    (Amen!). I guess that CVTCH only works with normal characters as input
    like 0-9 and A-Z.

    The question is here:
    Who can help me with a simular API like CVTCH wich returns the
    hexadecimal output string from an input string containing any kind of
    "strange" character? Or maybe I should ask my question like this: Does
    anyone know or have an idea how wrkdbf (F8) so easily represents the
    hexadecimal values of any character whatever the content?

    I.E.
    In goes a binary string 'Ûö•‰¸Ë·]' and out comes
    'DBF611950189B8CBB75D'.


    Any help or puss in the right direction would be appreciated!.

    Stack from Belgium.


  2. Re: In goes a binary string '.?˷]' and out comes HEX 'DBF611950189B8CBB75D'.

    I'm having trouble figuring out what direction you want to go.

    CVTCH, from my reading of the manual, take in char and gives out hex. For
    every two characters in you get 1 character out, i.e. the two characters
    c'C1' results in the one byte X'A1'. In this scenario, the only valid
    values in the input are 0-1, A-F.

    You might want CVTHC if you are trying to make viewable a field of hex
    values.
    http://publib.boulder.ibm.com/iserie...o/mi/CVTHC.htm

    Or you might want to try the SQL HEX function.

    Sam


    wrote in message
    news:1192748034.474538.247540@v29g2000prd.googlegr oups.com...
    Hi,
    I know the easiest way to convert chars c '1234' to hex c 'C1C2C3C4'
    is using the CVTCH MI function and this is exactly what I want and it
    works fine in my RPG pgm.

    The problem is here:
    Using an API 'Qc3EncryptData' which ecnrypts data, I receive a char-
    string which looks like x'DBF6' (presented as '') and so on in
    wrkdbf (F8). As soon as I send this (part of a) string to CVTCH I get
    a strange error like MCH3601 Pointer not set for location reference.
    (Amen!). I guess that CVTCH only works with normal characters as input
    like 0-9 and A-Z.

    The question is here:
    Who can help me with a simular API like CVTCH wich returns the
    hexadecimal output string from an input string containing any kind of
    "strange" character? Or maybe I should ask my question like this: Does
    anyone know or have an idea how wrkdbf (F8) so easily represents the
    hexadecimal values of any character whatever the content?

    I.E.
    In goes a binary string '.?˷]' and out comes
    'DBF611950189B8CBB75D'.


    Any help or puss in the right direction would be appreciated!.

    Stack from Belgium.



  3. =?iso-8859-1?q?Re:_In_goes_a_binary_string_'=DB=F6_=2E_=3F=B8 =CB=B7]'_and_out_comes_HEX_'DBF611950189B8CBB75D'=2E?=

    Well Sam,
    the the SQL HEX function is exactly what I was looking for. The HEX
    function returns the hexadecimal encoding of an integer expression.
    Sometimes the solution is not so far as it seems.
    Thank you.
    Stack



    On 19 okt, 02:25, "Saml" wrote:
    > I'm having trouble figuring out what direction you want to go.
    >
    > CVTCH, from my reading of the manual, take in char and gives out hex. For
    > every two characters in you get 1 character out, i.e. the two characters
    > c'C1' results in the one byte X'A1'. In this scenario, the only valid
    > values in the input are 0-1, A-F.
    >
    > You might want CVTHC if you are trying to make viewable a field of hex
    > values.http://publib.boulder.ibm.com/iserie...o/mi/CVTHC.htm
    >
    > Or you might want to try the SQL HEX function.
    >
    > Sam
    >
    > wrote in message
    >
    > news:1192748034.474538.247540@v29g2000prd.googlegr oups.com...
    > Hi,
    > I know the easiest way to convert chars c '1234' to hex c 'C1C2C3C4'
    > is using the CVTCH MI function and this is exactly what I want and it
    > works fine in my RPG pgm.
    >
    > The problem is here:
    > Using an API 'Qc3EncryptData' which ecnrypts data, I receive a char-
    > string which looks like x'DBF6' (presented as '') and so on in
    > wrkdbf (F8). As soon as I send this (part of a) string to CVTCH I get
    > a strange error like MCH3601 Pointer not set for location reference.
    > (Amen!). I guess that CVTCH only works with normal characters as input
    > like 0-9 and A-Z.
    >
    > The question is here:
    > Who can help me with a simular API like CVTCH wich returns the
    > hexadecimal output string from an input string containing any kind of
    > "strange" character? Or maybe I should ask my question like this: Does
    > anyone know or have an idea how wrkdbf (F8) so easily represents the
    > hexadecimal values of any character whatever the content?
    >
    > I.E.
    > In goes a binary string ' . ?˷]' and out comes
    > 'DBF611950189B8CBB75D'.
    >
    > Any help or puss in the right direction would be appreciated!.
    >
    > Stack from Belgium.




  4. Re: In goes a binary string =?ISO-8859-1?Q?=27=DB=F6_=2E_=3F?==?ISO-8859-1?Q?=B8=CB=B7=5D=27_and_out_comes_HEX_=27DBF611950 1?==?ISO-8859-1?Q?89B8CBB75D=27=2E?=

    Stack2Stack@gmail.com wrote:
    > Well Sam,
    > the the SQL HEX function is exactly what I was looking for. The HEX
    > function returns the hexadecimal encoding of an integer expression.
    > Sometimes the solution is not so far as it seems.
    >
    > On 19 okt, 02:25, "Saml" wrote:
    >> I'm having trouble figuring out what direction you want to go.
    >>
    >> CVTCH, from my reading of the manual, take in char and gives out hex. For
    >> every two characters in you get 1 character out, i.e. the two characters
    >> c'C1' results in the one byte X'A1'. In this scenario, the only valid
    >> values in the input are 0-1, A-F.
    >>
    >> You might want CVTHC if you are trying to make viewable a field of hex
    >> values.http://publib.boulder.ibm.com/iserie...o/mi/CVTHC.htm
    >>
    >> Or you might want to try the SQL HEX function.
    >>
    >> Sam
    >>
    >> wrote in message
    >>
    >> news:1192748034.474538.247540@v29g2000prd.googlegr oups.com...
    >> Hi,
    >> I know the easiest way to convert chars c '1234' to hex c 'C1C2C3C4'
    >> is using the CVTCH MI function and this is exactly what I want and it
    >> works fine in my RPG pgm.
    >>
    >> The problem is here:
    >> Using an API 'Qc3EncryptData' which ecnrypts data, I receive a char-
    >> string which looks like x'DBF6' (presented as '') and so on in
    >> wrkdbf (F8). As soon as I send this (part of a) string to CVTCH I get
    >> a strange error like MCH3601 Pointer not set for location reference.
    >> (Amen!). I guess that CVTCH only works with normal characters as input
    >> like 0-9 and A-Z.
    >>
    >> The question is here:
    >> Who can help me with a simular API like CVTCH wich returns the
    >> hexadecimal output string from an input string containing any kind of
    >> "strange" character? Or maybe I should ask my question like this: Does
    >> anyone know or have an idea how wrkdbf (F8) so easily represents the
    >> hexadecimal values of any character whatever the content?
    >>
    >> I.E.
    >> In goes a binary string ' . ?˷]' and out comes
    >> 'DBF611950189B8CBB75D'.
    >>
    >> Any help or puss in the right direction would be appreciated!.
    >>


    Yes, like the CVTHC (convert hex to character) function. Each 4 bit
    nibble is converted to equivalent 8 bit character:
    http://publib.boulder.ibm.com/infoce...s/sc092418.pdf

    --
    Karl Hanson

+ Reply to Thread