BookmarkSubscribeRSS Feed
helannivas88
Obsidian | Level 7

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

1 REPLY 1
Kurt_Bremser
Super User

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.

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

How to Concatenate Values

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 1 reply
  • 357 views
  • 0 likes
  • 2 in conversation