<?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 Loading Excel data with special foreign characters into SQL Server via SAS EG in SAS Data Management</title>
    <link>https://communities.sas.com/t5/SAS-Data-Management/Loading-Excel-data-with-special-foreign-characters-into-SQL/m-p/517200#M16049</link>
    <description>&lt;P&gt;&lt;EM&gt;Software Versions:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SAS EG 6.1,&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; MS Office 2010 Pro Plus 2010 ,&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SQL Server 2014,&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Linux 2.6.32-754.6.3.el6.x86_64&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Data is received from various countries in Excel. Some text fields contain special foreign characters. Import via the wizard is not used because numeric fields can have bogus text such as 'N/A', which throws off the data types. Worksheets from each country are saved as tab delimited files and copied to Linux folders from where they're concatenated in SAS Enterprise Guide&amp;nbsp;via a FILENAME statement and then input by a&amp;nbsp;data step. In the data step, the INFILE statement has&amp;nbsp;&amp;nbsp;&amp;nbsp; dsd dlm='09'x ENCODING='LATIN9'.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Everything works fine until the data is uploaded to SQL Server.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;To upload, first a libname mylib&amp;nbsp; statement signs on to the right datasrc and schema. Then proc sql is used to execute the following:&lt;BR /&gt;create table mylib.mytable as select * from mySASdataset;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The problem is that all text fields in SQL Server are uploaded as varchar ... not Nvarchar (i.e. unicode).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;1. In this case, does varchar instead of Nvarchar mean that various special foreign characters&amp;nbsp;might not be supported.&lt;BR /&gt;2. If so, how can the Nvarchar data type be forced for the fields that may contain special foreign characters?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 29 Nov 2018 19:23:54 GMT</pubDate>
    <dc:creator>SASame</dc:creator>
    <dc:date>2018-11-29T19:23:54Z</dc:date>
    <item>
      <title>Loading Excel data with special foreign characters into SQL Server via SAS EG</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Loading-Excel-data-with-special-foreign-characters-into-SQL/m-p/517200#M16049</link>
      <description>&lt;P&gt;&lt;EM&gt;Software Versions:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SAS EG 6.1,&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; MS Office 2010 Pro Plus 2010 ,&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SQL Server 2014,&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Linux 2.6.32-754.6.3.el6.x86_64&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Data is received from various countries in Excel. Some text fields contain special foreign characters. Import via the wizard is not used because numeric fields can have bogus text such as 'N/A', which throws off the data types. Worksheets from each country are saved as tab delimited files and copied to Linux folders from where they're concatenated in SAS Enterprise Guide&amp;nbsp;via a FILENAME statement and then input by a&amp;nbsp;data step. In the data step, the INFILE statement has&amp;nbsp;&amp;nbsp;&amp;nbsp; dsd dlm='09'x ENCODING='LATIN9'.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Everything works fine until the data is uploaded to SQL Server.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;To upload, first a libname mylib&amp;nbsp; statement signs on to the right datasrc and schema. Then proc sql is used to execute the following:&lt;BR /&gt;create table mylib.mytable as select * from mySASdataset;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The problem is that all text fields in SQL Server are uploaded as varchar ... not Nvarchar (i.e. unicode).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;1. In this case, does varchar instead of Nvarchar mean that various special foreign characters&amp;nbsp;might not be supported.&lt;BR /&gt;2. If so, how can the Nvarchar data type be forced for the fields that may contain special foreign characters?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 29 Nov 2018 19:23:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Loading-Excel-data-with-special-foreign-characters-into-SQL/m-p/517200#M16049</guid>
      <dc:creator>SASame</dc:creator>
      <dc:date>2018-11-29T19:23:54Z</dc:date>
    </item>
    <item>
      <title>Re: Loading Excel data with special foreign characters into SQL Server via SAS EG</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Loading-Excel-data-with-special-foreign-characters-into-SQL/m-p/517208#M16052</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;When loading into SQL Server only default Data Types are used by SQL Server interface. Check this &lt;A href="https://documentation.sas.com/?docsetId=acreldb&amp;amp;docsetTarget=n0h4i25zq3t58en1lgr8jjx1rads.htm&amp;amp;docsetVersion=9.4&amp;amp;locale=en" target="_self"&gt;document&lt;/A&gt; for Default SQL Server data types.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You may have to explicitly specify the format.&lt;/P&gt;
&lt;P&gt;1) Create a LIBNAME with connection=global and dbmstemp=yes&lt;/P&gt;
&lt;P&gt;2) Using pass-through create an empty table in SQL Server with required formats.&lt;/P&gt;
&lt;P&gt;3) Now, load the data into the empty table.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You need to setup a single connection to SQL Server that shared by multiple proc steps and data steps (step 1 does that).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This paper might help you some:&amp;nbsp;&lt;A href="https://www.lexjansen.com/sesug/2018/SESUG2018_Paper-154_Final_PDF.pdf" target="_blank"&gt;https://www.lexjansen.com/sesug/2018/SESUG2018_Paper-154_Final_PDF.pdf&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 29 Nov 2018 19:47:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Loading-Excel-data-with-special-foreign-characters-into-SQL/m-p/517208#M16052</guid>
      <dc:creator>SuryaKiran</dc:creator>
      <dc:date>2018-11-29T19:47:57Z</dc:date>
    </item>
    <item>
      <title>Re: Loading Excel data with special foreign characters into SQL Server via SAS EG</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Loading-Excel-data-with-special-foreign-characters-into-SQL/m-p/517232#M16053</link>
      <description>&lt;P&gt;Hi Suryakiran,&lt;/P&gt;&lt;P&gt;FANTASTIC !!!&amp;nbsp;&amp;nbsp;&amp;nbsp; Thank you so much !!!&lt;/P&gt;&lt;P&gt;-Peter&lt;/P&gt;</description>
      <pubDate>Thu, 29 Nov 2018 20:45:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Loading-Excel-data-with-special-foreign-characters-into-SQL/m-p/517232#M16053</guid>
      <dc:creator>SASame</dc:creator>
      <dc:date>2018-11-29T20:45:07Z</dc:date>
    </item>
  </channel>
</rss>

