BookmarkSubscribeRSS Feed
singhsahab
Lapis Lazuli | Level 10

HI All,

 

The given string "INFECTIONS -TUBO - NEW OR WORSENING" was converted automatically into "INFECTIONS -TUBO €“ NEW OR WORSENING" while connecting SAS to Oracle database. In SAS datasets it is showing right "INFECTIONS -TUBO - NEW OR WORSENING" and in oracle table it is sowing "INFECTIONS -TUBO €“ NEW OR WORSENING".

 

Can you please suggest how to prevent such type of conversion ? 

 

Thank you in advance !!

2 REPLIES 2
ChrisNZ
Tourmaline | Level 20

So many answers already on the web.

 

Like 

https://stackoverflow.com/questions/9773995/bad-encoding-why-does-my-medium-sized-dash-is-differentl...

http://community.teradata.com/t5/Database/Seeing-Junk-character-when-inserting-hyphen/td-p/27271

 

From the second link: "That combination of characters is the 3-byte UTF-8 representation of EN DASH U+2013, misinterpreted as Windows-1252. In short, you are loading UTF-8 data using ASCII as the session character set."

 

As @Kurt_Bremser said, you are mixing encodings.

Either you match the encodings of your Oracle data and your SAS data, or more likely you just clean your SAS strings to remove any non-latin characters. 

 

This should work, I can't test as my session is WLATIN1.

 

 STR=prxchange('s/[^[:ascii:]]/ /', -1, STR );

 

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
  • 2857 views
  • 1 like
  • 3 in conversation