<?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 Re: Encoding issue: Oracle (Latin-1) → Viya 4 (UTF-8) via LIBNAME in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Encoding-issue-Oracle-Latin-1-Viya-4-UTF-8-via-LIBNAME/m-p/965664#M375931</link>
    <description>&lt;P&gt;I would first suggest you check what your SAS Viya session setting is for this option:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc options option = dbclient_max_bytes;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Then try increasing it 1 byte at a time.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;There maybe other encoding options worth trying like:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data MyOraTable (encoding = wlatin1);
  set MyOraLIB.MyOraTable;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sun, 04 May 2025 00:18:01 GMT</pubDate>
    <dc:creator>SASKiwi</dc:creator>
    <dc:date>2025-05-04T00:18:01Z</dc:date>
    <item>
      <title>Encoding issue: Oracle (Latin-1) → Viya 4 (UTF-8) via LIBNAME</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Encoding-issue-Oracle-Latin-1-Viya-4-UTF-8-via-LIBNAME/m-p/965592#M375899</link>
      <description>&lt;P class=""&gt;Hi everyone,&lt;/P&gt;&lt;P class=""&gt;I’m connecting an Oracle database (Latin-1 character set) to a SAS Viya 4 (2024.03 LTS) session configured with UTF-8 encoding using the Oracle LIBNAME engine. When displaying data from tables containing accented characters, every non-ASCII byte appears corrupted as “?”.&lt;/P&gt;&lt;P class=""&gt;For example:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;P class=""&gt;&lt;STRONG&gt;Original:&lt;/STRONG&gt; &lt;CODE&gt;"Não informado"&lt;/CODE&gt;&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P class=""&gt;&lt;STRONG&gt;Displayed:&lt;/STRONG&gt; &lt;CODE&gt;"N?o informado"&lt;/CODE&gt;&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P class=""&gt;I've found the following encoding-related options for the LIBNAME statement:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;P class=""&gt;&lt;CODE&gt;DBCLIENT_ENCODING_FIXED=&lt;/CODE&gt; &lt;EM&gt;(YES|NO, based on SAS encoding)&lt;/EM&gt;&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P class=""&gt;&lt;CODE&gt;DBCLIENT_MAX_BYTES=&lt;/CODE&gt; &lt;EM&gt;(Maximum number of bytes per character of the SAS session encoding)&lt;/EM&gt;&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P class=""&gt;&lt;CODE&gt;DBSERVER_ENCODING_FIXED=&lt;/CODE&gt; &lt;EM&gt;(YES|NO, based on Oracle server encoding)&lt;/EM&gt;&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;CODE&gt;DBSERVER_MAX_BYTES=&lt;/CODE&gt;&amp;nbsp;&lt;EM&gt;(&lt;SPAN&gt;usually 1&lt;/SPAN&gt;)&lt;/EM&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P class=""&gt;What would be the recommended combination of these encoding options to correctly handle transcoding from Latin-1 to UTF-8?&lt;/P&gt;&lt;P class=""&gt;Are these options the correct or the only way to force proper transcoding from Latin-1 (Oracle) to UTF-8 (Viya 4) without data corruption?&lt;/P&gt;&lt;P class=""&gt;If not, could you recommend the best practice settings or any additional parameters required?&lt;/P&gt;&lt;P class=""&gt;Any examples or guidance would be greatly appreciated!&lt;/P&gt;&lt;P class=""&gt;Thanks in advance!&lt;/P&gt;</description>
      <pubDate>Fri, 02 May 2025 14:49:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Encoding-issue-Oracle-Latin-1-Viya-4-UTF-8-via-LIBNAME/m-p/965592#M375899</guid>
      <dc:creator>cristianstoe</dc:creator>
      <dc:date>2025-05-02T14:49:40Z</dc:date>
    </item>
    <item>
      <title>Re: Encoding issue: Oracle (Latin-1) → Viya 4 (UTF-8) via LIBNAME</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Encoding-issue-Oracle-Latin-1-Viya-4-UTF-8-via-LIBNAME/m-p/965664#M375931</link>
      <description>&lt;P&gt;I would first suggest you check what your SAS Viya session setting is for this option:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc options option = dbclient_max_bytes;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Then try increasing it 1 byte at a time.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;There maybe other encoding options worth trying like:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data MyOraTable (encoding = wlatin1);
  set MyOraLIB.MyOraTable;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 04 May 2025 00:18:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Encoding-issue-Oracle-Latin-1-Viya-4-UTF-8-via-LIBNAME/m-p/965664#M375931</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2025-05-04T00:18:01Z</dc:date>
    </item>
    <item>
      <title>Re: Encoding issue: Oracle (Latin-1) → Viya 4 (UTF-8) via LIBNAME</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Encoding-issue-Oracle-Latin-1-Viya-4-UTF-8-via-LIBNAME/m-p/965665#M375932</link>
      <description>&lt;P&gt;Going from a single byte encoding like LATIN1 to a multibyte encoding like UTF-8 should not normally cause issues since every LATIN1 character exists in the UTF-8 encoding.&amp;nbsp; But you might have truncation issues since the number of bytes needed to store some strings in UTF-8 will be more than the same strings would need in LATIN1.&amp;nbsp; &amp;nbsp;But that would not cause trouble at the beginning of a string like in your example.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So somehow SAS is probably not understanding that the characters from Oracle are in LATIN1 and so then sees the byte string as invalid and hence the ? is displayed.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you cannot get the connection fixed you might be able to fix the issue your self after getting the data in SAS by calling the KCVT function.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data saslib.mytable;
  set oralib.mytable;
  string = kcvt(myvar,'latin1','utf-8');
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sun, 04 May 2025 01:11:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Encoding-issue-Oracle-Latin-1-Viya-4-UTF-8-via-LIBNAME/m-p/965665#M375932</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2025-05-04T01:11:13Z</dc:date>
    </item>
  </channel>
</rss>

