<?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: How to encode a dataset to UTF-8 in SAS studio? in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-to-encode-a-dataset-to-UTF-8-in-SAS-studio/m-p/897310#M354569</link>
    <description>- Encoding used in the sas session is UTF8 &lt;BR /&gt;- SQLserver is running on windows &lt;BR /&gt;- SAS is running on unix</description>
    <pubDate>Thu, 05 Oct 2023 06:40:58 GMT</pubDate>
    <dc:creator>Mayt</dc:creator>
    <dc:date>2023-10-05T06:40:58Z</dc:date>
    <item>
      <title>How to encode a dataset to UTF-8 in SAS studio?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-encode-a-dataset-to-UTF-8-in-SAS-studio/m-p/897110#M354509</link>
      <description>&lt;P&gt;Hi everyone!&lt;/P&gt;
&lt;P&gt;I have connected SAS code to SQLserver but the dataset&amp;nbsp; can't display Thai character.&amp;nbsp;But when I have tried connecting SAS code to PostgreSQL, it works&amp;nbsp; and displays Thai character perfectly fine. However I need to connect with SQLserver. Please advise me. Thank you in advance.&lt;/P&gt;
&lt;P&gt;&lt;LI-WRAPPER&gt;&lt;/LI-WRAPPER&gt;&lt;/P&gt;
&lt;P&gt;My code:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;libname sslib1 sqlsvr noprompt="DRIVER=SAS ACCESS to MS SQL Server;
UID=&lt;EM&gt;my UID&lt;/EM&gt; ;PWD=&lt;EM&gt;my Password&lt;/EM&gt;;
HOST=&lt;EM&gt;My host&lt;/EM&gt; ;PORT=&lt;EM&gt;My port&lt;/EM&gt;; schema=dbo";&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;And some columns&amp;nbsp; appear like this:&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Any Thai character appears as �&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Mayt_0-1696407947782.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/88571i9CC6A45F76ABA7ED/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Mayt_0-1696407947782.png" alt="Mayt_0-1696407947782.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;While the dataset connected with PostGreSQL&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Mayt_1-1696410486236.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/88572iFB5D484E118E9B49/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Mayt_1-1696410486236.png" alt="Mayt_1-1696410486236.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have tried&amp;nbsp;&lt;/P&gt;
&lt;P&gt;1.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;libname sslib1 sqlsvr noprompt="DRIVER=SAS ACCESS to MS SQL Server;
UID=&lt;EM&gt;my UID&lt;/EM&gt; ;PWD=&lt;EM&gt;my Password&lt;/EM&gt;;
HOST=&lt;EM&gt;My host&lt;/EM&gt; ;PORT=&lt;EM&gt;My port&lt;/EM&gt;; client_encoding='UTF-8'; schema=dbo";&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;2. or add&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc options option=encoding;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;3. or create a new table&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql;
create table work.test(encoding='utf8') as
SELECT * FROM sslib1.mytable(encoding='utf8');
quit;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;But still Thai characters appears as&amp;nbsp;&lt;SPAN&gt;�&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 04 Oct 2023 09:08:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-encode-a-dataset-to-UTF-8-in-SAS-studio/m-p/897110#M354509</guid>
      <dc:creator>Mayt</dc:creator>
      <dc:date>2023-10-04T09:08:48Z</dc:date>
    </item>
    <item>
      <title>Re: How to encode a dataset to UTF-8 in SAS studio?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-encode-a-dataset-to-UTF-8-in-SAS-studio/m-p/897112#M354510</link>
      <description>What is the encoding used in the sas session? Is sqlserver running on windows or unix? Is sas running on windows?</description>
      <pubDate>Wed, 04 Oct 2023 10:03:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-encode-a-dataset-to-UTF-8-in-SAS-studio/m-p/897112#M354510</guid>
      <dc:creator>JosvanderVelden</dc:creator>
      <dc:date>2023-10-04T10:03:35Z</dc:date>
    </item>
    <item>
      <title>Re: How to encode a dataset to UTF-8 in SAS studio?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-encode-a-dataset-to-UTF-8-in-SAS-studio/m-p/897310#M354569</link>
      <description>- Encoding used in the sas session is UTF8 &lt;BR /&gt;- SQLserver is running on windows &lt;BR /&gt;- SAS is running on unix</description>
      <pubDate>Thu, 05 Oct 2023 06:40:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-encode-a-dataset-to-UTF-8-in-SAS-studio/m-p/897310#M354569</guid>
      <dc:creator>Mayt</dc:creator>
      <dc:date>2023-10-05T06:40:58Z</dc:date>
    </item>
  </channel>
</rss>

