<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic How do I read SQL special characters correctly in SAS EG in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-do-I-read-SQL-special-characters-correctly-in-SAS-EG/m-p/746647#M234243</link>
    <description>&lt;P&gt;&lt;SPAN&gt;Calling on my SAS community. I need a little help. We have some data that is not playing nice. This data contains about 6 fields with various types of comments. It's stored in SQL and we use Enterprise Guide metadata to make our Oracle connections. The problem is that depending on how the data was entered, it can cause special characters that read fine in SQL, to only display as "?" in SAS. I can do a series of If Then statements or Case statements to fix this but I know that's only a bandage. I'm sure there's some conversion or something I could to make it so. I've tried encoding options or KCVT function. It doesn't seem to help. Any other options???&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="questionmark.JPG" style="width: 999px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/60163i5B2F0553E32A1603/image-size/large?v=v2&amp;amp;px=999" role="button" title="questionmark.JPG" alt="questionmark.JPG" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 09 Jun 2021 02:57:37 GMT</pubDate>
    <dc:creator>schatja</dc:creator>
    <dc:date>2021-06-09T02:57:37Z</dc:date>
    <item>
      <title>How do I read SQL special characters correctly in SAS EG</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-do-I-read-SQL-special-characters-correctly-in-SAS-EG/m-p/746647#M234243</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Calling on my SAS community. I need a little help. We have some data that is not playing nice. This data contains about 6 fields with various types of comments. It's stored in SQL and we use Enterprise Guide metadata to make our Oracle connections. The problem is that depending on how the data was entered, it can cause special characters that read fine in SQL, to only display as "?" in SAS. I can do a series of If Then statements or Case statements to fix this but I know that's only a bandage. I'm sure there's some conversion or something I could to make it so. I've tried encoding options or KCVT function. It doesn't seem to help. Any other options???&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="questionmark.JPG" style="width: 999px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/60163i5B2F0553E32A1603/image-size/large?v=v2&amp;amp;px=999" role="button" title="questionmark.JPG" alt="questionmark.JPG" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 09 Jun 2021 02:57:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-do-I-read-SQL-special-characters-correctly-in-SAS-EG/m-p/746647#M234243</guid>
      <dc:creator>schatja</dc:creator>
      <dc:date>2021-06-09T02:57:37Z</dc:date>
    </item>
    <item>
      <title>Re: How do I read SQL special characters correctly in SAS EG</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-do-I-read-SQL-special-characters-correctly-in-SAS-EG/m-p/746649#M234245</link>
      <description>&lt;P&gt;Interesting.&amp;nbsp; Do you know the exact hexidecimal values for those "?" marks?&amp;nbsp; Perhaps you could grab a few examples, isolate the word that has the "?", and then use the $HEX format to write the actual hexidecimal value to the SAS log.&amp;nbsp; I suspect what may be happening is that these may be "smart" quotes or some such that are not part of the base ASCII character set.&amp;nbsp; Really only values 00 through 7F have standard definitions.&amp;nbsp; For the extended range, 80 - FF, different machines do different things.&amp;nbsp; I suspect the server is doing it one way and SAS is doing it another, at least that's what I've seen in the past.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Why don't you determine the exact ASCII values (hexidecimal values in other words), and then we can go from there?&amp;nbsp; We can do some kind of Translate function or some such to convert from the values the server is using to something that works in SAS.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Jim&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;P.S.&amp;nbsp; In addition to the above, could you run the following code and post the results?&amp;nbsp; Also, could you ask whomsoever administers the database what encoding they are using?&amp;nbsp; The answers to these may give us a more elegant way of resolving this issue.&amp;nbsp; I see that you've played with the encoding already, so we may need to use TRANSLATE, but still I'm curious as to what's really going on, and perhaps something will yet occur to us that has not yet.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;PROC	OPTIONS	OPTION=ENCODING;
RUN;

PROC	OPTIONS	OPTION=LOCALE;
RUN;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 09 Jun 2021 04:04:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-do-I-read-SQL-special-characters-correctly-in-SAS-EG/m-p/746649#M234245</guid>
      <dc:creator>jimbarbour</dc:creator>
      <dc:date>2021-06-09T04:04:18Z</dc:date>
    </item>
    <item>
      <title>Re: How do I read SQL special characters correctly in SAS EG</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-do-I-read-SQL-special-characters-correctly-in-SAS-EG/m-p/746651#M234246</link>
      <description>&lt;P&gt;Things to check:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;encoding of the sas-session&lt;/LI&gt;
&lt;LI&gt;encoding used in oracle&lt;/LI&gt;
&lt;LI&gt;encoding-setting in the connection from sas to oracle&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;Most likely oracle uses utf-8, but sas uses some old-school ascii-encoding. Unfortunately you can't just change the encoding of the sas-session, the admins have to setup an app-server using unicode / utf-8.&lt;/P&gt;</description>
      <pubDate>Wed, 09 Jun 2021 05:00:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-do-I-read-SQL-special-characters-correctly-in-SAS-EG/m-p/746651#M234246</guid>
      <dc:creator>andreas_lds</dc:creator>
      <dc:date>2021-06-09T05:00:47Z</dc:date>
    </item>
    <item>
      <title>Re: How do I read SQL special characters correctly in SAS EG</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-do-I-read-SQL-special-characters-correctly-in-SAS-EG/m-p/746722#M234280</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/270512"&gt;@schatja&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;Please have a look at this&amp;nbsp;&lt;A href="https://blogs.sas.com/content/sgf/2017/05/19/demystifying-and-resolving-common-transcoding-problems/" target="_blank"&gt;https://blogs.sas.com/content/sgf/2017/05/19/demystifying-and-resolving-common-transcoding-problems/&lt;/A&gt;&amp;nbsp;&lt;BR /&gt;Multiple strategies have been discussed. Please look at the &lt;STRONG&gt;Suppress transcoding&amp;nbsp;&lt;/STRONG&gt; section&lt;STRONG&gt;. &lt;/STRONG&gt;That may help resolve some of the issues you have.&lt;/P&gt;</description>
      <pubDate>Wed, 09 Jun 2021 12:28:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-do-I-read-SQL-special-characters-correctly-in-SAS-EG/m-p/746722#M234280</guid>
      <dc:creator>Sajid01</dc:creator>
      <dc:date>2021-06-09T12:28:09Z</dc:date>
    </item>
  </channel>
</rss>

