Hi,
I'm trying to establish a connection from SAS Platform (runs in latin9) to one of the DB2 source system. But I'm getting a following error
ERROR: CLI error trying to establish connection: [IBM][CLI Driver] SQL0332N Character conversion from the source code page "0" to
the target code page "923" is not supported. SQLSTATE=õ÷ðñ÷
So I tried an option of defining a DB2CODEPAGE as 819 in level_env_usermods.sh file and then ran the same libname statement and it ran successfully.
But i dont want to set this codepage in the config file because we are connecting multiple DB2 system from SAS and only one DB2 system has this problem. I'm thinking to define the DB2CODEPAGE in the SAS EG session (code) before invoking the libname statement. I have tried with below option
options set=DB2CODEPAGE=819;
libname test DB2 datasrc=xxx .............................
but ended up in the same error. How to rectify this problem. Please let me know.
Thanks
The problem you face is that you need to send that option to the DB/2 client, which takes it from the environment variable. Since all that is set before the SAS session even starts, you cannot influence it from the SAS program.
I have not found any codepage-related options in the documentation of ACCESS to DB/2.
It might be that you have to set up a separate application server context in metadata and configuration for this DB/2 connection, and set the environment variable in the appservercontext_env_usermods.sh of that server context.
Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9. Sign up by March 14 for just $795.
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.