View Full Version : EBCDIC to ASCII conversion on AS/400
Guest.Visitor
01-01-1995, 02:00 AM
Hi all, I want to convert the available ASCII data to EBCDIC format and a vis-a-versa. Are there any inbuild API's in AS/400 to do the function for me, If yes then then where can i get the detailed info of these API's? I would like to see some examples on these API's where can I get them? Pls help me! Thanks and Regards Suresh
Guest.Visitor
05-22-2000, 01:05 PM
Would suggest an API named QDCXLATE. A complete description may be found in the OS/400 National Language Support API manual. It works well
Guest.Visitor
05-22-2000, 01:21 PM
The following is a procedure that I created for writing and reading data in the IFS, using the QDCXLATE API. This procedure uses the TCP/IP translation tables in library QUSRSYS. There are other translation tables available, but these work for my application. <pre> *--------------------------------------------------------------------- * @StringXlate -Translate String- EBCDIC to ASCII and ASCII to EBCDIC *--------------------------------------------------------------------- P @StringXlate B D @StringXlate PI 32702 D p_XlateOutput 1 const D p_StringToXlt 32702 const * Definitions for Locally Defined/Used Work Fields D w_XlateString S 32702 D w_StringLngth S 5P 0 D w_CnvTable S 10 D w_CnvTblLib S 10 D c_AsciiToEbcdc C const('A') D c_EbcdicToAsci C const('E') C eval w_XlateString = p_StringtoXlt C eval w_CnvTblLib = 'QUSRSYS ' C eval w_StringLngth = 32702 C select C When p_XlateOutPut = c_EbcdicToAsci C eval w_CnvTable = 'QTCPASC ' C When p_XlateOutPut = c_AsciiToEbcdc C eval w_CnvTable = 'QTCPEBC ' C endSl C call 'QDCXLATE' C parm w_StringLngth C parm w_XlateString C parm w_CnvTable C parm w_CnvTblLib C return w_XlateString P E </pre> Hope this helps.
Powered by vBulletin® Version 4.1.5 Copyright © 2013 vBulletin Solutions, Inc. All rights reserved.