<?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 Excel Import to SAS 9.4 in SAS Data Management</title>
    <link>https://communities.sas.com/t5/SAS-Data-Management/Excel-Import-to-SAS-9-4/m-p/239689#M6218</link>
    <description>&lt;P&gt;I am trying to import an excel data with a variable contains both numeric and alpha numeric values. Unfortunately SAS determinies the variable type by looking at first observations and the variable got converted to Numeric type. Hence the alpha numeric values are not appearing in the imported data in SAS. Is there any way to import the data in specific format that we define.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Background:&amp;nbsp; I am trying to automated a reporting process where there are several excel files with multiple sheets. Idea&amp;nbsp;is to use only program. My Excel is 32 bit and SAS is 64 bit. Hence using&amp;nbsp;&amp;nbsp;DBMS=EXCELCS in proc import statement.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please help.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 17 Dec 2015 02:05:56 GMT</pubDate>
    <dc:creator>liju</dc:creator>
    <dc:date>2015-12-17T02:05:56Z</dc:date>
    <item>
      <title>Excel Import to SAS 9.4</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Excel-Import-to-SAS-9-4/m-p/239689#M6218</link>
      <description>&lt;P&gt;I am trying to import an excel data with a variable contains both numeric and alpha numeric values. Unfortunately SAS determinies the variable type by looking at first observations and the variable got converted to Numeric type. Hence the alpha numeric values are not appearing in the imported data in SAS. Is there any way to import the data in specific format that we define.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Background:&amp;nbsp; I am trying to automated a reporting process where there are several excel files with multiple sheets. Idea&amp;nbsp;is to use only program. My Excel is 32 bit and SAS is 64 bit. Hence using&amp;nbsp;&amp;nbsp;DBMS=EXCELCS in proc import statement.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please help.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 17 Dec 2015 02:05:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Excel-Import-to-SAS-9-4/m-p/239689#M6218</guid>
      <dc:creator>liju</dc:creator>
      <dc:date>2015-12-17T02:05:56Z</dc:date>
    </item>
    <item>
      <title>Re: Excel Import to SAS 9.4</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Excel-Import-to-SAS-9-4/m-p/239691#M6219</link>
      <description>&lt;P&gt;One workaround is to&amp;nbsp;insert a dummy first row of data with character values in it where you are getting the wrong type, then in SAS delete the first row after reading it in.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You could also try changing the column type in Excel from the default General to Text.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;A third option is to do a "text to columns" translation on the affected columns&amp;nbsp;using&amp;nbsp;Excel's Data tab.&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 17 Dec 2015 02:21:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Excel-Import-to-SAS-9-4/m-p/239691#M6219</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2015-12-17T02:21:03Z</dc:date>
    </item>
    <item>
      <title>Re: Excel Import to SAS 9.4</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Excel-Import-to-SAS-9-4/m-p/239694#M6220</link>
      <description>&lt;P&gt;Hi , Thank you for&amp;nbsp;a quick reply on this. Yes this solution will work for sure. But since&amp;nbsp;I&amp;nbsp;am trying to automate the process i didnt want the user to open every excel file and manually change the type. It is not actually practical as there several of such excel files. Any thoughts ?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks a lot for helping.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Liju.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 17 Dec 2015 02:27:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Excel-Import-to-SAS-9-4/m-p/239694#M6220</guid>
      <dc:creator>liju</dc:creator>
      <dc:date>2015-12-17T02:27:14Z</dc:date>
    </item>
    <item>
      <title>Re: Excel Import to SAS 9.4</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Excel-Import-to-SAS-9-4/m-p/239703#M6221</link>
      <description>&lt;P&gt;OK, if this applies to multiple spreadsheets then you could&amp;nbsp;read them via a LIBNAME with the EXCEL engine.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Then you&amp;nbsp;can use the DBSASTYPE option to enforce the data type that SAS reads the columns in as. This assumes that the column names you get are always consistent though. There are some useful examples in this paper:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="http://support.sas.com/resources/papers/proceedings11/076-2011.pdf" target="_blank"&gt;http://support.sas.com/resources/papers/proceedings11/076-2011.pdf&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 17 Dec 2015 03:46:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Excel-Import-to-SAS-9-4/m-p/239703#M6221</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2015-12-17T03:46:47Z</dc:date>
    </item>
    <item>
      <title>Re: Excel Import to SAS 9.4</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Excel-Import-to-SAS-9-4/m-p/239725#M6222</link>
      <description>&lt;P&gt;Well, your problem is that your are using Excel as a data transfer file format, which it is not. &amp;nbsp;You will encounter all kinds of issues and problems by doing it this way. &amp;nbsp;Ideally you would want to, in conjunction with the data vendor, setup a data transfer agreement which details file structure and uses a proper data transfer medium, such as CSV or XML. &amp;nbsp;This is the most robust safe method for both parties as the agreement defines the files. &amp;nbsp;Whilst you can have an agreement with Excel files, there can still be a fair few problems, such as this where Excel strusture is not database like - i.e. each cell can be its own format. &amp;nbsp;Simply put, fixing the source of these problems, i.e. not using Excel, would be the optimal approach. &amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you still insist on using Excel, there is a registry hack, also there is the mixed=yes options:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://communities.sas.com/t5/SAS-Procedures/GUESSINGROWS-EXCEL-to-SAS/td-p/18505" target="_blank"&gt;https://communities.sas.com/t5/SAS-Procedures/GUESSINGROWS-EXCEL-to-SAS/td-p/18505&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;However, what happens if the data changes, i.e. its all numeric, then there are characters, your code would need to change, what happens if there are special characters, hidden information, cells move about etc. Far too many problems using Excel.&lt;/P&gt;</description>
      <pubDate>Thu, 17 Dec 2015 09:43:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Excel-Import-to-SAS-9-4/m-p/239725#M6222</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2015-12-17T09:43:45Z</dc:date>
    </item>
    <item>
      <title>Re: Excel Import to SAS 9.4</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Excel-Import-to-SAS-9-4/m-p/239816#M6227</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/25295"&gt;@liju&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;I am trying to import an excel data with a variable contains both numeric and alpha numeric values. Unfortunately SAS determinies the variable type by looking at first observations and the variable got converted to Numeric type. Hence the alpha numeric values are not appearing in the imported data in SAS. Is there any way to import the data in specific format that we define.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Minor correction in understanding of what is going on: Excel tells SAS what the variables are and uses a very small number of rows to determine whether to consider character.&lt;/P&gt;
&lt;P&gt;This type of behavior is one reason why Excel is generally a poor medium for interchanging data.&lt;/P&gt;</description>
      <pubDate>Thu, 17 Dec 2015 19:09:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Excel-Import-to-SAS-9-4/m-p/239816#M6227</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2015-12-17T19:09:00Z</dc:date>
    </item>
  </channel>
</rss>

