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-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

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