<?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 can I import a xlsx file with both dates and Chinese characters? in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-can-I-import-a-xlsx-file-with-both-dates-and-Chinese/m-p/454323#M114824</link>
    <description>&lt;P&gt;What encoding are you using in your SAS session?&amp;nbsp; Check the ENCODING option.&amp;nbsp; You should be using&amp;nbsp; UTF-8.&lt;/P&gt;
&lt;P&gt;You need to start SAS with the right encoding setting if you want to be able to read multi-byte character sets.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But if your only issue is that your date variable is character then just convert it.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want ;
  set have ;
  numdate = input(chardate,yymmdd10.);
  format numdate yymmdd10. ;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Perhaps the things that look like hyphens between the parts of the date values are not really hyphens?&amp;nbsp; If so then you could remove them using COMPRESS() function.&lt;/P&gt;</description>
    <pubDate>Sun, 15 Apr 2018 23:54:39 GMT</pubDate>
    <dc:creator>Tom</dc:creator>
    <dc:date>2018-04-15T23:54:39Z</dc:date>
    <item>
      <title>How can I import a xlsx file with both dates and Chinese characters?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-can-I-import-a-xlsx-file-with-both-dates-and-Chinese/m-p/454312#M114817</link>
      <description>&lt;P&gt;I have been stuck by this for several hours. I first tried&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;proc import datafile = "&amp;amp;path\example"
out = x
dbms = xlsx
replace;
getnames = yes;
run;&lt;/PRE&gt;&lt;P&gt;it can work, but the date variable is recognized as character. I also tried to save the excel file as csv, but Chinese characters will be missing.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;A small example data is attached.&lt;/P&gt;</description>
      <pubDate>Sun, 15 Apr 2018 22:54:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-can-I-import-a-xlsx-file-with-both-dates-and-Chinese/m-p/454312#M114817</guid>
      <dc:creator>xyxu</dc:creator>
      <dc:date>2018-04-15T22:54:00Z</dc:date>
    </item>
    <item>
      <title>Re: How can I import a xlsx file with both dates and Chinese characters?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-can-I-import-a-xlsx-file-with-both-dates-and-Chinese/m-p/454323#M114824</link>
      <description>&lt;P&gt;What encoding are you using in your SAS session?&amp;nbsp; Check the ENCODING option.&amp;nbsp; You should be using&amp;nbsp; UTF-8.&lt;/P&gt;
&lt;P&gt;You need to start SAS with the right encoding setting if you want to be able to read multi-byte character sets.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But if your only issue is that your date variable is character then just convert it.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want ;
  set have ;
  numdate = input(chardate,yymmdd10.);
  format numdate yymmdd10. ;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Perhaps the things that look like hyphens between the parts of the date values are not really hyphens?&amp;nbsp; If so then you could remove them using COMPRESS() function.&lt;/P&gt;</description>
      <pubDate>Sun, 15 Apr 2018 23:54:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-can-I-import-a-xlsx-file-with-both-dates-and-Chinese/m-p/454323#M114824</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2018-04-15T23:54:39Z</dc:date>
    </item>
    <item>
      <title>Re: How can I import a xlsx file with both dates and Chinese characters?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-can-I-import-a-xlsx-file-with-both-dates-and-Chinese/m-p/454376#M114845</link>
      <description>You can use the dbencoding option.&lt;BR /&gt;&lt;BR /&gt;More info in link below:&lt;BR /&gt;&lt;A href="http://documentation.sas.com/?docsetId=acpcref&amp;amp;docsetTarget=p0okk0tdn5y5arn1x7zky4cz3m41.htm&amp;amp;docsetVersion=9.4&amp;amp;locale=en" target="_blank"&gt;http://documentation.sas.com/?docsetId=acpcref&amp;amp;docsetTarget=p0okk0tdn5y5arn1x7zky4cz3m41.htm&amp;amp;docsetVersion=9.4&amp;amp;locale=en&lt;/A&gt;</description>
      <pubDate>Mon, 16 Apr 2018 08:21:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-can-I-import-a-xlsx-file-with-both-dates-and-Chinese/m-p/454376#M114845</guid>
      <dc:creator>mnjtrana</dc:creator>
      <dc:date>2018-04-16T08:21:10Z</dc:date>
    </item>
    <item>
      <title>Re: How can I import a xlsx file with both dates and Chinese characters?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-can-I-import-a-xlsx-file-with-both-dates-and-Chinese/m-p/454439#M114857</link>
      <description>&lt;P&gt;Thanks for the reply! Yes, I was using SAS 9.4 (Chinese) version. I can use proc import and then convert chardate to date. However, when I sort nodupkey with Chinese-valued variables, the result messes up.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Would this be caused by the length of these variables? One of them is&amp;nbsp;$152.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 16 Apr 2018 14:28:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-can-I-import-a-xlsx-file-with-both-dates-and-Chinese/m-p/454439#M114857</guid>
      <dc:creator>xyxu</dc:creator>
      <dc:date>2018-04-16T14:28:53Z</dc:date>
    </item>
  </channel>
</rss>

