i5/OS™ PASE supports the DB2® UDB for iSeries™ Call Level Interface (CLI). DB2 CLI on AIX® and i5/OS are not proper subsets of each other, so there are minor differences in a few interfaces, and some APIs in one implementation might not exist in another.
Because of this, you should consider the following points:
i5/OS is an EBCDIC encoded system by default, while AIX is based on ASCII. This difference often requires data conversions between the i5/OS database (DB2 UDB for iSeries) and the i5/OS PASE application.
In the i5/OS PASE implementation of the DB2 CLI, i5/OS PASE system-provided library routines automatically perform data conversions from ASCII to Extended Binary Coded Decimal Interchange Code (EBCDIC) and back for character data. The conversions are made based on the tagged CCSID of the data being accessed and the ASCII CCSID under which the i5/OS PASE program is running. If the database is tagged, or if it is tagged with a CCSID of 65535, no automatic conversion takes place. It is left to the application to understand the encoding format of the data and to do any necessary conversion.
When you use the Qp2RunPase() API, you must explicitly specify the i5/OS PASE CCSID.
You can control the i5/OS PASE CCSID by setting both of these variables in the ILE before you call API program QP2TERM, QP2SHELL, or QP2SHELL2:
If the ILE omits either or both of these variables, QP2TERM, QP2SHELL, and QP2SHELL2 by default set the i5/OS PASE CCSID and i5/OS PASE environment variable LANG with the best i5/OS PASE equivalents of the language and CCSID attributes of your job.
Extensions to libc.a give the i5/OS PASE application the ability to change the running CCSID of the application, using the _SETCCSID() function.
Another extension gives the i5/OS PASE application the ability to override the DB2 CLI internal conversion without changing the CCSID of the application. The SQLOverrideCCSID400() function accepts an integer of the override CCSID as a single parameter.
To use DB2 CLI in your i5/OS PASE programs, you need to copy the sqlcli.h header file and the libdb400.exp export file to your AIX system before you compile your source. The DB2 CLI library routines are in libdb400.a for the i5/OS PASE environment, and are implemented using pthread interfaces, providing thread safety. Most i5/OS PASE CLI functions call corresponding ILE CLI functions to perform the required operation.