When we run a db2 application, if DB2CODEPAGE profile variable is set
then application will run in the same codepage, but if it is not set then
it will find out the underlying OS codepage and application will run with
In my case, I have an Embedded SQL program running in C on DB2/6000 7.1. I
want to find out the codepage in which the application is running from
inside the program during runtime.
Any body has any idea how to find application codepage from inside the
As for DB2 V7, I think You can get DB2CODEPAGE value from SQLCA.SQLERRM field when Connecton has completed.
( some information is provided delimited by x'ff' and it's 2ND )
Please see "DB2 Management API" manual " sqlegins " API for description .
( you don't have to use Managenet API to connect .
you can test using Command Center with "Show sqlca" option ON
and type "CONNECT TO XXXX")