<?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: Reading Excel file and determining data type in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Reading-Excel-file-and-determining-data-type/m-p/32118#M6182</link>
    <description>I have tried changing the Guessingrows option in the Registry Editor but it doesn't seem to work with Excel files.&lt;BR /&gt;
I really wish they would provide a simpler work around for this since the source date I am using is sort of funky when saved as csv.</description>
    <pubDate>Wed, 02 Feb 2011 23:49:31 GMT</pubDate>
    <dc:creator>deleted_user</dc:creator>
    <dc:date>2011-02-02T23:49:31Z</dc:date>
    <item>
      <title>Reading Excel file and determining data type</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Reading-Excel-file-and-determining-data-type/m-p/32115#M6179</link>
      <description>Is there any best way reading excel file without loosing data. Since sas will determine data type of each column with respect to first 8 rows of data u will end up having lot of missing values.&lt;BR /&gt;
&lt;BR /&gt;
&lt;A href="http://support.sas.com/kb/6/123.html" target="_blank"&gt;http://support.sas.com/kb/6/123.html&lt;/A&gt;&lt;BR /&gt;
&lt;BR /&gt;
I tried all the tricks stated in the above link. But I could not get any solution.</description>
      <pubDate>Wed, 10 Nov 2010 22:18:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Reading-Excel-file-and-determining-data-type/m-p/32115#M6179</guid>
      <dc:creator>anandbillava</dc:creator>
      <dc:date>2010-11-10T22:18:52Z</dc:date>
    </item>
    <item>
      <title>Re: Reading Excel file and determining data type</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Reading-Excel-file-and-determining-data-type/m-p/32116#M6180</link>
      <description>try to use &lt;B&gt;guessing rows=10000;&lt;/B&gt; to tell sas to read more rows to determine the data format, or save your excel file to csv file, then input.</description>
      <pubDate>Thu, 11 Nov 2010 00:16:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Reading-Excel-file-and-determining-data-type/m-p/32116#M6180</guid>
      <dc:creator>piggy</dc:creator>
      <dc:date>2010-11-11T00:16:11Z</dc:date>
    </item>
    <item>
      <title>Re: Reading Excel file and determining data type</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Reading-Excel-file-and-determining-data-type/m-p/32117#M6181</link>
      <description>I am pretty sure the guessingrows option doesn't work with EXCEL imports, but the save to CSV is a good choice as guessingrows works with that.&lt;BR /&gt;
&lt;BR /&gt;
Another way is to use a LIBNAME with the EXCEL option and then use DBSASTYPE to control the SAS column definitions.&lt;BR /&gt;
&lt;BR /&gt;
A quick and dirty approach is to put a single quote into the first blank row of the columns in the spreadsheet you wish to be treated as character.</description>
      <pubDate>Thu, 11 Nov 2010 01:17:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Reading-Excel-file-and-determining-data-type/m-p/32117#M6181</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2010-11-11T01:17:49Z</dc:date>
    </item>
    <item>
      <title>Re: Reading Excel file and determining data type</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Reading-Excel-file-and-determining-data-type/m-p/32118#M6182</link>
      <description>I have tried changing the Guessingrows option in the Registry Editor but it doesn't seem to work with Excel files.&lt;BR /&gt;
I really wish they would provide a simpler work around for this since the source date I am using is sort of funky when saved as csv.</description>
      <pubDate>Wed, 02 Feb 2011 23:49:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Reading-Excel-file-and-determining-data-type/m-p/32118#M6182</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2011-02-02T23:49:31Z</dc:date>
    </item>
    <item>
      <title>Re: Reading Excel file and determining data type</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Reading-Excel-file-and-determining-data-type/m-p/32119#M6183</link>
      <description>If your file is CSV read the file using Proc Import. Then copy the code from the log and modify it to read correctly by changing the formats required. You can use ALT+mouse to select the data without the row numbers.</description>
      <pubDate>Wed, 02 Feb 2011 23:59:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Reading-Excel-file-and-determining-data-type/m-p/32119#M6183</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2011-02-02T23:59:16Z</dc:date>
    </item>
    <item>
      <title>Re: Reading Excel file and determining data type</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Reading-Excel-file-and-determining-data-type/m-p/32120#M6184</link>
      <description>I've found that the only failsafe way to read Excel data values that might vary is to write specific DATA step logic.&lt;BR /&gt;
&lt;BR /&gt;
For example, any columns in Excel (CSV) that might be a problem are read in as $ character variables. I then check the values as per the intended data type and use INPUT () only when the value has been validated.&lt;BR /&gt;
&lt;BR /&gt;
If you're importing Excel XLS spreadsheet files, that is tricky. But if saving the XLS as CSV first is an option, try that.</description>
      <pubDate>Tue, 08 Feb 2011 23:35:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Reading-Excel-file-and-determining-data-type/m-p/32120#M6184</guid>
      <dc:creator>boschy</dc:creator>
      <dc:date>2011-02-08T23:35:04Z</dc:date>
    </item>
    <item>
      <title>Re: Reading Excel file and determining data type</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Reading-Excel-file-and-determining-data-type/m-p/32121#M6185</link>
      <description>i used connect to excel  in proc sql and it worked.</description>
      <pubDate>Wed, 09 Feb 2011 16:42:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Reading-Excel-file-and-determining-data-type/m-p/32121#M6185</guid>
      <dc:creator>SASPhile</dc:creator>
      <dc:date>2011-02-09T16:42:26Z</dc:date>
    </item>
    <item>
      <title>Re: Reading Excel file and determining data type</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Reading-Excel-file-and-determining-data-type/m-p/32122#M6186</link>
      <description>you have to decide&lt;BR /&gt;
data or code&lt;BR /&gt;
If you have invalid data, how do you want to handle it?&lt;BR /&gt;
There is no fail-safe for all the possible problems that can happen, to deliver data you can call clean and sufficient.&lt;BR /&gt;
So decide the number of errors to tolerate before rejecting the input and requiring better quality.&lt;BR /&gt;
 &lt;BR /&gt;
If your data in excel do have an intended structure, then use that structure information in a data step (or sql) with the DBSASTYPE option. This tells excel how to deliver the data. When they don't conform, you will get missing values and perhaps "invalid data" messages.&lt;BR /&gt;
The online doc for DBSASTYPE  &lt;A href="http://support.sas.com/documentation/cdl/en/acpcref/63184/HTML/default/viewer.htm#a002261324.htm" target="_blank"&gt;http://support.sas.com/documentation/cdl/en/acpcref/63184/HTML/default/viewer.htm#a002261324.htm&lt;/A&gt;</description>
      <pubDate>Thu, 10 Feb 2011 11:29:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Reading-Excel-file-and-determining-data-type/m-p/32122#M6186</guid>
      <dc:creator>Peter_C</dc:creator>
      <dc:date>2011-02-10T11:29:52Z</dc:date>
    </item>
    <item>
      <title>Re: Reading Excel file and determining data type</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Reading-Excel-file-and-determining-data-type/m-p/32123#M6187</link>
      <description>Hi.&lt;BR /&gt;
I think it does work. and I also test it.&lt;BR /&gt;
The problem occurred is beacuse of a variable has both numeric and character value,&lt;BR /&gt;
and SAS only allow one of both type.&lt;BR /&gt;
So the way to solve it is to use ' mixed=yes' statement in 'proc import'.&lt;BR /&gt;
Or change it into csv and use proper informat to input.&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
Ksharp</description>
      <pubDate>Wed, 23 Feb 2011 07:36:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Reading-Excel-file-and-determining-data-type/m-p/32123#M6187</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2011-02-23T07:36:03Z</dc:date>
    </item>
  </channel>
</rss>

