Thanks,
Rob
-----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
-----== Over 100,000 Newsgroups - 19 Different Servers! =-----
You may try the cvthc() MI function to convert a hex string to its character
representation:
*
* Convert Hex to Character (CVTHC)
D cvthc...
D PR extproc('cvthc')
D i_pReceiver * value
D i_pSource * value
D i_size 10I 0 value
clear USR2966;
USR29661 = '';
cvthc(%addr(USR29662): %addr(i_eolChar):
%len(%trimR(i_eolChar)) * 2);
msg = f_newMsg('USR2966': USR2966);
In the sample given above i_eolChar contains a hex string that is converted
to a character string which is put into USR29661. E.g. given that i_eolChar
contained x'OD25' (2-byte hex string which is the ebcdic code for CR+LF),
USR29661 would contain '0D25' (4-byte character string) after having called
cvthc(). The length of i_eolChar has to be multiplied by 2 because the
length is specified in nibbles.
From the C Library Reference manual:
void cvthc (_SPCPTR receiver,
_SPCPTRCN source,
int size);
Description:
The cvthc function takes each hexadecimal digit (4- bit value) of source and
converts it to a character digit (8-bit value) and places into receiver.
Parameters:
receiver (input/output)
Pointer to an 8-bit character value.
source (input)
Pointer to a 4-bit hexadecimal value.
size (input)
The length in nibbles of the source.
Thomas Raddatz.
--
*=====================================================*
e-mail Adresse:
Thomas....@tools400.de
Homepage:
http://www.tools400.de
*=====================================================*
"ra" <r...@yahoo.com> schrieb im Newsbeitrag
news:4017ee25$1...@corp.newsgroups.com...
I forgot to mention that you have to specify the QC2LE binding directory at
the CRTPGM command or BNDDIR('QC2LE') at the H-spec.
Thomas Raddatz.
--
*=====================================================*
e-mail Adresse:
Thomas....@tools400.de
Homepage:
http://www.tools400.de
*=====================================================*
"Thomas Raddatz" <thomas....@tools400.de> schrieb im Newsbeitrag
news:bv978o$le7$1...@online.de...
the simplest way to show the hex values of a field is to use
SQL-Scalar-Function HEX():
C/EXEC SQL
C+ Set :MyHexField = Hex(:MyField)
C/END-EXEC
Birgitta
"ra" <r...@yahoo.com> wrote in message news:<4017ee25$1...@corp.newsgroups.com>...
HTH
Alex
"ra" <r...@yahoo.com> wrote in message news:4017ee25$1...@corp.newsgroups.com...
"ra" <r...@yahoo.com> wrote in message news:4017ee25$1...@corp.newsgroups.com...
HTH,
Chris
"ra" <r...@yahoo.com> wrote in message news:4017ee25$1...@corp.newsgroups.com...
Sam
"Chris" <y...@dontneedtoknow.com> wrote in message
news:EXjSb.179953$I06.1901089@attbi_s01...