<?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 infile encoding issue in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/infile-encoding-issue/m-p/635174#M188570</link>
    <description>&lt;P&gt;Morning!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have transcoding problem.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;A CSV(contain English and Chinese character) to be imported to SAS format.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;1. workable code&lt;/P&gt;&lt;P&gt;data &amp;amp;filename ; ;&lt;BR /&gt;infile "&amp;amp;filepath" delimiter = ',' ENCODING="UTF-8" MISSOVER DSD lrecl=32767 firstobs=2 ;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;2.failure code&lt;/P&gt;&lt;P&gt;libname dw "..." Inencoding=any;&lt;/P&gt;&lt;P&gt;data dw.&amp;amp;filename ; ;&lt;BR /&gt;infile "&amp;amp;filepath" delimiter = ',' ENCODING="UTF-8" MISSOVER DSD lrecl=32767 firstobs=2 ;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;3. error log&lt;/P&gt;&lt;P&gt;ERROR: Some character data was lost during transcoding in the dataset DW.TRANSACTIONS_HIST_TABLE_20200325.&lt;BR /&gt;Either the data contains characters that are not representable in the new encoding or truncation occurred&lt;BR /&gt;during transcoding.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;As you can see, if import to work, code runs OK without error;(English/number/Chinese are imported correctly)&lt;/P&gt;&lt;P&gt;while import to libname DW, code runs with error. (English/number are imported correctly, Chinese character not imported)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;SAS 9.3/EG 5.1 used. Chinese language supported.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can anyone give a solution?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks and Regards,&lt;/P&gt;&lt;P&gt;Dawn&lt;/P&gt;</description>
    <pubDate>Fri, 27 Mar 2020 01:43:22 GMT</pubDate>
    <dc:creator>Dawn_Wu</dc:creator>
    <dc:date>2020-03-27T01:43:22Z</dc:date>
    <item>
      <title>infile encoding issue</title>
      <link>https://communities.sas.com/t5/SAS-Programming/infile-encoding-issue/m-p/635174#M188570</link>
      <description>&lt;P&gt;Morning!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have transcoding problem.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;A CSV(contain English and Chinese character) to be imported to SAS format.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;1. workable code&lt;/P&gt;&lt;P&gt;data &amp;amp;filename ; ;&lt;BR /&gt;infile "&amp;amp;filepath" delimiter = ',' ENCODING="UTF-8" MISSOVER DSD lrecl=32767 firstobs=2 ;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;2.failure code&lt;/P&gt;&lt;P&gt;libname dw "..." Inencoding=any;&lt;/P&gt;&lt;P&gt;data dw.&amp;amp;filename ; ;&lt;BR /&gt;infile "&amp;amp;filepath" delimiter = ',' ENCODING="UTF-8" MISSOVER DSD lrecl=32767 firstobs=2 ;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;3. error log&lt;/P&gt;&lt;P&gt;ERROR: Some character data was lost during transcoding in the dataset DW.TRANSACTIONS_HIST_TABLE_20200325.&lt;BR /&gt;Either the data contains characters that are not representable in the new encoding or truncation occurred&lt;BR /&gt;during transcoding.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;As you can see, if import to work, code runs OK without error;(English/number/Chinese are imported correctly)&lt;/P&gt;&lt;P&gt;while import to libname DW, code runs with error. (English/number are imported correctly, Chinese character not imported)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;SAS 9.3/EG 5.1 used. Chinese language supported.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can anyone give a solution?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks and Regards,&lt;/P&gt;&lt;P&gt;Dawn&lt;/P&gt;</description>
      <pubDate>Fri, 27 Mar 2020 01:43:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/infile-encoding-issue/m-p/635174#M188570</guid>
      <dc:creator>Dawn_Wu</dc:creator>
      <dc:date>2020-03-27T01:43:22Z</dc:date>
    </item>
    <item>
      <title>Re: infile encoding issue</title>
      <link>https://communities.sas.com/t5/SAS-Programming/infile-encoding-issue/m-p/635176#M188571</link>
      <description>&lt;P&gt;Morning All,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;To make up.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;error accurred when libname is a share folder on server other than local ;&lt;/P&gt;&lt;P&gt;no error when libname is any folder of local PC.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Dawn&lt;/P&gt;</description>
      <pubDate>Fri, 27 Mar 2020 02:02:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/infile-encoding-issue/m-p/635176#M188571</guid>
      <dc:creator>Dawn_Wu</dc:creator>
      <dc:date>2020-03-27T02:02:51Z</dc:date>
    </item>
    <item>
      <title>Re: infile encoding issue</title>
      <link>https://communities.sas.com/t5/SAS-Programming/infile-encoding-issue/m-p/635178#M188573</link>
      <description>&lt;P&gt;1.&lt;EM&gt; &amp;gt; error accurred when libname is a share folder on server other than local&lt;/EM&gt; &lt;/P&gt;
&lt;P&gt;How do you access the server location?&lt;/P&gt;
&lt;P&gt;UNC path such as \\server\path ?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;2. What OS for the local machine and for the server?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;3. &lt;EM&gt;libname dw "..." Inencoding=any;&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;Why use inencoding=&amp;nbsp; (please use a lower case i to make things more legible) when you use the library for output?&lt;/P&gt;
&lt;P&gt;outencoding= would seem more useful here.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;4. Why not use&amp;nbsp;&amp;nbsp; &lt;SPAN style="left: 156px; top: 765.885px; font-size: 15px; font-family: monospace; transform: scaleX(0.99631);"&gt;encoding='UTF-8'&amp;nbsp;&lt;/SPAN&gt; as a libname or as a data set option, rather than&amp;nbsp; encoding=&lt;SPAN style="left: 156px; top: 765.885px; font-size: 15px; font-family: monospace; transform: scaleX(0.99631);"&gt;any&amp;nbsp; &lt;/SPAN&gt;?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 27 Mar 2020 03:14:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/infile-encoding-issue/m-p/635178#M188573</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2020-03-27T03:14:20Z</dc:date>
    </item>
    <item>
      <title>Re: infile encoding issue</title>
      <link>https://communities.sas.com/t5/SAS-Programming/infile-encoding-issue/m-p/635180#M188575</link>
      <description>&lt;P&gt;Do you mean the libref is using the REMOTE engine to connect to a SAS/Share server?&amp;nbsp; What encoding is the remote session using?&lt;/P&gt;</description>
      <pubDate>Fri, 27 Mar 2020 03:20:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/infile-encoding-issue/m-p/635180#M188575</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2020-03-27T03:20:31Z</dc:date>
    </item>
  </channel>
</rss>

