<?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: Question about using proc import to read multiple spreadsheets from an excel file in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Question-about-using-proc-import-to-read-multiple-spreadsheets/m-p/159864#M41679</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you!&amp;nbsp; That explains a lot.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 15 May 2014 14:57:42 GMT</pubDate>
    <dc:creator>kellyA</dc:creator>
    <dc:date>2014-05-15T14:57:42Z</dc:date>
    <item>
      <title>Question about using proc import to read multiple spreadsheets from an excel file</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Question-about-using-proc-import-to-read-multiple-spreadsheets/m-p/159862#M41677</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I need to read in a ~40 spreadsheet excel file.&amp;nbsp; I found this macro posted on another forum, which has been incredible helpful-&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%macro imp (insheet=); &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; proc import out=work.&amp;amp;insheet &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; datafile= "filename.xls" &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; dbms=excel replace; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; sheet="&amp;amp;insheet.$"; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; getnames=YES; mixed=NO; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; scantext=YES; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; usedate=YES; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; scantime=YES;&lt;/P&gt;&lt;P&gt;%mend imp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However, I need to add in "guessingrows=500;" but the macro fails every time I include it. Now the macro looks like this-&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%macro impb (insheet=); &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; proc import out=work.&amp;amp;insheet &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; datafile= "filename.xls" &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; dbms=excel replace; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; sheet="&amp;amp;insheet.$"; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; getnames=YES; mixed=NO; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; guessingrows=500;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; usedate=YES; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; scantime=YES;&lt;/P&gt;&lt;P&gt;%mend impb;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And error messages look like this-&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;NOTE: The previous statement has been deleted.&lt;/P&gt;&lt;P&gt;NOTE: The previous statement has been deleted.&lt;/P&gt;&lt;P&gt;ERROR 180-322: Statement is not valid or it is used out of proper order.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've searched around and can't figure out why the macro no longer works.&amp;nbsp; Obviously it looks like is has something to do with the order, but I have moved the guessingrows statement to no success.&amp;nbsp; Thoughts?&amp;nbsp; Thanks in advance for your help!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 May 2014 14:40:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Question-about-using-proc-import-to-read-multiple-spreadsheets/m-p/159862#M41677</guid>
      <dc:creator>kellyA</dc:creator>
      <dc:date>2014-05-15T14:40:23Z</dc:date>
    </item>
    <item>
      <title>Re: Question about using proc import to read multiple spreadsheets from an excel file</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Question-about-using-proc-import-to-read-multiple-spreadsheets/m-p/159863#M41678</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Guessingrows is not an option for xls imports.&amp;nbsp; Have a look at this recent post on the subject: &lt;A _jive_internal="true" class="active_link" href="https://communities.sas.com/thread/57776"&gt;https://communities.sas.com/thread/57776&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Alternatively you could write a small vba macro to save all the excel files to delimited and then read that in with a datastep, which gives you full control over the data.&amp;nbsp; I posted an example vba macro some time back, will see if I can find it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Something like this: &lt;A class="active_link" href="http://spreadsheetpage.com/index.php/tip/getting_a_list_of_file_names_using_vba/"&gt;http://spreadsheetpage.com/index.php/tip/getting_a_list_of_file_names_using_vba/&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Just add in a line for SaveAs :filetype=...&lt;/P&gt;&lt;P&gt;Then run that in Excel and select your folder of Excel files.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 May 2014 14:49:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Question-about-using-proc-import-to-read-multiple-spreadsheets/m-p/159863#M41678</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2014-05-15T14:49:39Z</dc:date>
    </item>
    <item>
      <title>Re: Question about using proc import to read multiple spreadsheets from an excel file</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Question-about-using-proc-import-to-read-multiple-spreadsheets/m-p/159864#M41679</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you!&amp;nbsp; That explains a lot.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 May 2014 14:57:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Question-about-using-proc-import-to-read-multiple-spreadsheets/m-p/159864#M41679</guid>
      <dc:creator>kellyA</dc:creator>
      <dc:date>2014-05-15T14:57:42Z</dc:date>
    </item>
  </channel>
</rss>

