<?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: Importing excel file problem of reading special characters in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Importing-excel-file-problem-of-reading-special-characters/m-p/340861#M77955</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;Thanks for your effort.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I follow your code as it is but got error in log.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;proc sql dquote=ansi;
 connect to excel (Path="D:\sas\book1.xlsx" mixed=yes);
    select
        put(cats(substr(v4,2,1),substr(v4,1,1)),$hex4.) as unicode

        as hope from connection to Excel
        (
         Select
            StrConv (var,64)  as v4
         from
           [sheet1$]
        );
    disconnect from Excel;
Quit;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;ERROR: Open cursor: Too few parameters. Expected 1.&lt;/P&gt;</description>
    <pubDate>Tue, 14 Mar 2017 16:49:39 GMT</pubDate>
    <dc:creator>Ravikumarkummari</dc:creator>
    <dc:date>2017-03-14T16:49:39Z</dc:date>
    <item>
      <title>Importing excel file problem of reading special characters</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Importing-excel-file-problem-of-reading-special-characters/m-p/340360#M77773</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;
&lt;P&gt;I have data in excel, that contains special characters, when importing into sas instead of special characters&amp;nbsp;&lt;/P&gt;
&lt;TABLE style="border-collapse: collapse; width: 48pt;" border="0" width="64" cellspacing="0" cellpadding="0"&gt;&lt;COLGROUP&gt;&lt;COL style="width: 48pt;" width="64" /&gt; &lt;/COLGROUP&gt;
&lt;TBODY&gt;
&lt;TR style="height: 15.75pt;"&gt;
&lt;TD width="64" height="21" class="xl64" style="height: 15.75pt; width: 48pt;"&gt;&amp;nbsp;≥&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.75pt;"&gt;
&lt;TD height="21" class="xl63" style="height: 15.75pt;"&gt;&amp;nbsp;≤&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;it reading only equals to symbol (=). how to import this data with actual data.&lt;/P&gt;
&lt;P&gt;I follow below code for this.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;/*1st method*/&lt;BR /&gt;proc import datafile="D:\sas\book1.xlsx"&lt;BR /&gt;out=data&lt;BR /&gt;dbms=excel&lt;BR /&gt;replace;&lt;BR /&gt;getnames=yes;&lt;BR /&gt;scantext=yes;&lt;BR /&gt;mixed=yes;&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;/*2nd method*/&lt;BR /&gt;libname data excel "D:\sas\book1.xlsx";&lt;/P&gt;
&lt;P&gt;data sheet_data;&lt;BR /&gt;set data."sheet1$"n;&lt;BR /&gt;run;&lt;/P&gt;</description>
      <pubDate>Mon, 13 Mar 2017 10:47:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Importing-excel-file-problem-of-reading-special-characters/m-p/340360#M77773</guid>
      <dc:creator>Ravikumarkummari</dc:creator>
      <dc:date>2017-03-13T10:47:34Z</dc:date>
    </item>
    <item>
      <title>Re: Importing excel file problem of reading special characters</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Importing-excel-file-problem-of-reading-special-characters/m-p/340368#M77776</link>
      <description>&lt;P&gt;No good posting Excel files, they are dangerous to download. &amp;nbsp;As for your question, have you et your SAS session as UTF8:&lt;/P&gt;
&lt;P&gt;&lt;A href="http://support.sas.com/kb/42/831.html" target="_blank"&gt;http://support.sas.com/kb/42/831.html&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 13 Mar 2017 11:11:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Importing-excel-file-problem-of-reading-special-characters/m-p/340368#M77776</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2017-03-13T11:11:05Z</dc:date>
    </item>
    <item>
      <title>Re: Importing excel file problem of reading special characters</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Importing-excel-file-problem-of-reading-special-characters/m-p/340622#M77870</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;Converting symbols in excel to SAS unicode

inspired by
https://goo.gl/kFXGEY
https://communities.sas.com/t5/Base-SAS-Programming/Importing-excel-file-problem-of-reading-special-characters/m-p/340360

HAVE an excel sheet with symbols

 see ops sheet

Here is what the ops sheet looks like with sasfont unicode

 e"
 d"
 ±&amp;#3;
 ²&amp;#3;
 ³&amp;#3;
 ´&amp;#3;
 $
 ^
 ~
WANT (Unicode for each symbol)

  2265  greater than or equal
  2264  less than or equal
  03B1  alpha
  03B2  beta
  03B3  gamma
  03B4  delta
  0024  $
  005E  ^
  007E  `

WORKING SOLUTION
===================

  Excel SQL convert var to unicode

   StrConv (var,64)  as v4

FULL SOLUTION
=============

proc sql dquote=ansi;
 connect to excel (Path="d:/xls/special.xlsx" mixed=yes);
    select
        put(cats(substr(v4,2,1),substr(v4,1,1)),$hex4.) as unicode

        as hope from connection to Excel
        (
         Select
            StrConv (var,64)  as v4
         from
           [sheet1$]
        );
    disconnect from Excel;
Quit;

&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 14 Mar 2017 02:14:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Importing-excel-file-problem-of-reading-special-characters/m-p/340622#M77870</guid>
      <dc:creator>rogerjdeangelis</dc:creator>
      <dc:date>2017-03-14T02:14:27Z</dc:date>
    </item>
    <item>
      <title>Re: Importing excel file problem of reading special characters</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Importing-excel-file-problem-of-reading-special-characters/m-p/340623#M77871</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;Slight typo in previous post(still works though)

proc sql dquote=ansi;
 connect to excel (Path="d:/xls/special.xlsx" mixed=yes);
    select
        put(cats(substr(v4,2,1),substr(v4,1,1)),$hex4.) as unicode
        from connection to Excel
        (
         Select
            StrConv (var,64)  as v4
         from
           [sheet1$]
        );
    disconnect from Excel;
Quit;

&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 14 Mar 2017 02:18:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Importing-excel-file-problem-of-reading-special-characters/m-p/340623#M77871</guid>
      <dc:creator>rogerjdeangelis</dc:creator>
      <dc:date>2017-03-14T02:18:05Z</dc:date>
    </item>
    <item>
      <title>Re: Importing excel file problem of reading special characters</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Importing-excel-file-problem-of-reading-special-characters/m-p/340747#M77934</link>
      <description>&lt;P&gt;&lt;FONT face="verdana,geneva"&gt;This worked for me with SAS 9.4 M3 started with Unicode support:&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;options validvarname=any;

proc import out=work.book1
  file='C:\temp\book1.xlsx'
  dbms=xlsx
  replace;
run; quit;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;FONT face="verdana,geneva"&gt;Vince DelGobbo&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="verdana,geneva"&gt;SAS R&amp;amp;D&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 14 Mar 2017 12:12:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Importing-excel-file-problem-of-reading-special-characters/m-p/340747#M77934</guid>
      <dc:creator>Vince_SAS</dc:creator>
      <dc:date>2017-03-14T12:12:49Z</dc:date>
    </item>
    <item>
      <title>Re: Importing excel file problem of reading special characters</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Importing-excel-file-problem-of-reading-special-characters/m-p/340861#M77955</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;Thanks for your effort.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I follow your code as it is but got error in log.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;proc sql dquote=ansi;
 connect to excel (Path="D:\sas\book1.xlsx" mixed=yes);
    select
        put(cats(substr(v4,2,1),substr(v4,1,1)),$hex4.) as unicode

        as hope from connection to Excel
        (
         Select
            StrConv (var,64)  as v4
         from
           [sheet1$]
        );
    disconnect from Excel;
Quit;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;ERROR: Open cursor: Too few parameters. Expected 1.&lt;/P&gt;</description>
      <pubDate>Tue, 14 Mar 2017 16:49:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Importing-excel-file-problem-of-reading-special-characters/m-p/340861#M77955</guid>
      <dc:creator>Ravikumarkummari</dc:creator>
      <dc:date>2017-03-14T16:49:39Z</dc:date>
    </item>
  </channel>
</rss>

