<?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: Proc import for xls, variable names start from row 3, multiple sheets in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Proc-import-for-xls-variable-names-start-from-row-3-multiple/m-p/133223#M36196</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The following will work with the given changes:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PROC SQL;&lt;/P&gt;&lt;P&gt;CONNECT TO EXCEL (PATH='c:\sasdemo\sasdemo.xlsx');&lt;/P&gt;&lt;P&gt;SELECT * FROM CONNECTION TO EXCEL&lt;/P&gt;&lt;P&gt;&amp;nbsp; (SELECT * FROM [A_Sheet_Name_Longer_Than_Thirty_Two_Chars$]);&lt;/P&gt;&lt;P&gt;DISCONNECT FROM EXCEL;&lt;/P&gt;&lt;P&gt;QUIT;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also, for Names on third row, namerow and datarow options can be used in the same sql procedure in connect statement. For multiple sheets, macro can help.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 19 Dec 2013 11:38:29 GMT</pubDate>
    <dc:creator>JatinBansal</dc:creator>
    <dc:date>2013-12-19T11:38:29Z</dc:date>
    <item>
      <title>Proc import for xls, variable names start from row 3, multiple sheets</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-import-for-xls-variable-names-start-from-row-3-multiple/m-p/133220#M36193</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm trying to import an xls file into SAS which has the variable names starting in row 3 (as opposed to row 2) and there are several sheets that contain the data that I need. However, there are a couple of sheets that I do NOT need to pull data from. When I specified a sheet name, I get an error in the log telling me, "that my sheet name is too long for a SAS name in this context." While I can probably very easily just change the sheet names, that wouldn't be a long term solution. So three questions:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. How can I pull the variable names from row 3? I know I can use RANGE for that but if there are other options as well, I'm open to hearing them.&lt;/P&gt;&lt;P&gt;2. What can I do about my sheet name problem?&lt;/P&gt;&lt;P&gt;3. How can I import just the sheets that I need? My guess is to list each one individually but there has to be a more efficient way.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 05 Nov 2013 22:46:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-import-for-xls-variable-names-start-from-row-3-multiple/m-p/133220#M36193</guid>
      <dc:creator>emcee825</dc:creator>
      <dc:date>2013-11-05T22:46:58Z</dc:date>
    </item>
    <item>
      <title>Re: Proc import for xls, variable names start from row 3, multiple sheets</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-import-for-xls-variable-names-start-from-row-3-multiple/m-p/133221#M36194</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try adding these statements to your PROC IMPORT: namerow=3; startrow = 3;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If your sheet names are greater than 32 characters then I don't think there is any workaround using PROC IMPORT, apart from renaming them to be no more than 32.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The 32 char limit applies to any tables referenced in the SAS environment, including external databases.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The only way I'm aware of to deal with external table names longer than 32 chars is to use SQL Passthru. Check out this link:&lt;/P&gt;&lt;P&gt;&lt;A href="http://support.sas.com/documentation/cdl/en/acpcref/64792/HTML/default/viewer.htm#n0f5mkuxiitygvn16n6nwc3j2oqh.htm"&gt;http://support.sas.com/documentation/cdl/en/acpcref/64792/HTML/default/viewer.htm#n0f5mkuxiitygvn16n6nwc3j2oqh.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;A sample program could look like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PROC SQL;&lt;/P&gt;&lt;P&gt;CONNECT TO EXCEL (PATH='c:\sasdemo\sasdemo.xlsx');&lt;/P&gt;&lt;P&gt;SELECT * FROM CONNECTION TO EXCEL&lt;/P&gt;&lt;P&gt;&amp;nbsp; (SELECT * FROM A_Sheet_Name_Longer_Than_Thirty_Two_Chars);&lt;/P&gt;&lt;P&gt;DISCONNECT FROM EXCEL;&lt;/P&gt;&lt;P&gt;QUIT;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 05 Nov 2013 23:30:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-import-for-xls-variable-names-start-from-row-3-multiple/m-p/133221#M36194</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2013-11-05T23:30:25Z</dc:date>
    </item>
    <item>
      <title>Re: Proc import for xls, variable names start from row 3, multiple sheets</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-import-for-xls-variable-names-start-from-row-3-multiple/m-p/133222#M36195</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi SASKiwi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks so much for your response. I tried using the sample code you provided for PROC SQL but am given the following error in the log:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ERROR: Describe: The Microsoft Office Access database engine could not find the object&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 'QUANT_Screening_Roster_081713'.&amp;nbsp; Make sure the object exists and that you spell its&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; name and the path name correctly.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm confused as to why SAS thinks I'm looking for an Access db (I used your code, exactly, and just changed the file path). I did double check to make sure that I spelled everything correctly by copying and pasting the file path and the sheet name but no luck. As far as I can tell from the SAS help &amp;amp; documentations, everything looks correct...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also, while we're on this topic, I would like to import multiple sheets. I'm not sure what the syntax would look for that-- would I do multiple (SELECT * FROM Sheet_Name);? Would you happen to know?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks again, it's much appreciated.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 12 Nov 2013 19:34:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-import-for-xls-variable-names-start-from-row-3-multiple/m-p/133222#M36195</guid>
      <dc:creator>emcee825</dc:creator>
      <dc:date>2013-11-12T19:34:15Z</dc:date>
    </item>
    <item>
      <title>Re: Proc import for xls, variable names start from row 3, multiple sheets</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-import-for-xls-variable-names-start-from-row-3-multiple/m-p/133223#M36196</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The following will work with the given changes:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PROC SQL;&lt;/P&gt;&lt;P&gt;CONNECT TO EXCEL (PATH='c:\sasdemo\sasdemo.xlsx');&lt;/P&gt;&lt;P&gt;SELECT * FROM CONNECTION TO EXCEL&lt;/P&gt;&lt;P&gt;&amp;nbsp; (SELECT * FROM [A_Sheet_Name_Longer_Than_Thirty_Two_Chars$]);&lt;/P&gt;&lt;P&gt;DISCONNECT FROM EXCEL;&lt;/P&gt;&lt;P&gt;QUIT;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also, for Names on third row, namerow and datarow options can be used in the same sql procedure in connect statement. For multiple sheets, macro can help.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Dec 2013 11:38:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-import-for-xls-variable-names-start-from-row-3-multiple/m-p/133223#M36196</guid>
      <dc:creator>JatinBansal</dc:creator>
      <dc:date>2013-12-19T11:38:29Z</dc:date>
    </item>
  </channel>
</rss>

