× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



On 5/14/07, Ruthirapathi, Arulanandham
<Arulanandham.Ruthirapathi@xxxxxxxxxxxxxxx> wrote:
How do I get EBCDIC and ASCII value of a character?

Please provide me a code snippet.


calling QDCXLATE is the simplest way. If you need to convert from one
ccsid to another you would use the iconv family of unix apis.

-Steve

** ---------------------- Qdcxlate ----------------------
** Qdcxlate - convert data using translation table
dQdcxlate pr extpgm('QDCXLATE')
d InDataLx 5p 0 const
d IoData 32767a options(*VarSize)
d InXltTbl 10a const

** ------------------- fDataToAscii ----------------------
pfDataToAscii b export
dfDataToAscii pi
d IoData 32767a options(*VarSize)
d InDataLx 10i 0 value
/free
Qdcxlate( InDataLx: IoData: 'QASCII' ) ;
/end-free
p e

** ------------------- fDataToEbcdic ---------------------
pfDataToEbcdic b export
dfDataToEbcdic pi
d IoData 32767a options(*VarSize)
d InDataLx 10i 0 value
/free
Qdcxlate( InDataLx: IoData: 'QEBCDIC' ) ;
/end-free
p e

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.