04-16-2018 11:45 AM
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 !!
04-16-2018 11:53 AM
Use a $hex. format, so you can see what is actually stored. Your second hyphen is most probably not a standard hyphen, but a UTF character.
04-16-2018 08:13 PM - edited 04-16-2018 08:14 PM
So many answers already on the web.
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 @KurtBremser 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 );