BookmarkSubscribeRSS Feed
david_wang
Calcite | Level 5

Hi, I'm new to SAS VIYA, and wanna help if anyone can.

 

In my working SAS VIYA environment, a PostgreSQL database is connected but the encoding method of that db is LATIN1. So, when I caslib that postgres db and load some data-set into cas server, any fields that contain the Chinese value will display the error codes. I know absolutely the reason is the utf-8 encoding environment of SAS VIYA have some conflict with the original LATIN1 of that PostgreSQL db. But for some reason, I cannot modify the encoding environment of PostgreSQL db into utf-8.

 

AS a solution may not be so good, I find a way to change the Chinese contents of the table in PostgreSQL db into hex, just like from "中" to "\xD6D0". And to my surprise, the contents of "\xD6D0" load into CAS server unchanged. Thus, my question here is how can I get the original "中" by coverting the "\xD6D0" in SAS VIYA. If it is likely to do so, the problem above might be solved.

 

Any help or suggestion are welcome! Thank you!

2 REPLIES 2
Tom
Super User Tom
Super User

I don't understand. How did the Chinese characters get into the PostgreSQL database if it is using LATIN1 encoding?

david_wang
Calcite | Level 5
hi, I'm not famaliar with the Postgres SQL db.But I use the "show server_encoding" and "show client_encoding", the result is all LATIN1.

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 16. Read more here about why you should contribute and what is in it for you!

Submit your idea!

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
  • 2 replies
  • 863 views
  • 0 likes
  • 2 in conversation