<?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 Excel: get column names from different range in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Proc-Import-Excel-get-column-names-from-different-range/m-p/356952#M64265</link>
    <description>&lt;P&gt;Hi, I am using SAS9.3. The above code is importing a maximum of 142 columns. Please help. - Thanks in advance.&lt;/P&gt;</description>
    <pubDate>Mon, 08 May 2017 17:28:46 GMT</pubDate>
    <dc:creator>soumoboxi</dc:creator>
    <dc:date>2017-05-08T17:28:46Z</dc:date>
    <item>
      <title>Proc Import Excel: get column names from different range</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-Import-Excel-get-column-names-from-different-range/m-p/51087#M13965</link>
      <description>&lt;P&gt;Hi &lt;BR /&gt; &lt;BR /&gt; How would i go about selecting row 3 as the variable names and then say &lt;BR /&gt; row 4 to 11?&lt;BR /&gt; &lt;BR /&gt; &lt;BR /&gt; PROC IMPORT DATAFILE= "c:\Assurance\Scorecard.xls" DBMS=EXCEL out = TotalSubscribers&lt;BR /&gt; replace;&lt;BR /&gt; SHEET="'Fobe'";&lt;BR /&gt; RANGE='a4:ax11';&lt;BR /&gt; GETNAMES=YES;&lt;BR /&gt; MIXED=NO;&lt;BR /&gt; SCANTEXT=YES;&lt;BR /&gt; USEDATE=YES;&lt;BR /&gt; SCANTIME=YES;&lt;BR /&gt; &lt;BR /&gt; RUN;&lt;BR /&gt; &lt;BR /&gt; &lt;BR /&gt; &lt;BR /&gt; &lt;BR /&gt; Fred Message was edited by: fredbell&lt;/P&gt;</description>
      <pubDate>Wed, 26 Apr 2017 11:53:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-Import-Excel-get-column-names-from-different-range/m-p/51087#M13965</guid>
      <dc:creator>fredbell</dc:creator>
      <dc:date>2017-04-26T11:53:24Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Import Excel</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-Import-Excel-get-column-names-from-different-range/m-p/51088#M13966</link>
      <description>You are very close.  Change your range to include the row with the variable names.</description>
      <pubDate>Thu, 16 Dec 2010 18:11:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-Import-Excel-get-column-names-from-different-range/m-p/51088#M13966</guid>
      <dc:creator>ArtC</dc:creator>
      <dc:date>2010-12-16T18:11:24Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Import Excel</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-Import-Excel-get-column-names-from-different-range/m-p/51089#M13967</link>
      <description>Thanks but what if i also need to RANGE='a40:ax60';&lt;BR /&gt;
&lt;BR /&gt;
How do i get Variable names and then define the range?&lt;BR /&gt;
&lt;BR /&gt;
Fred</description>
      <pubDate>Thu, 16 Dec 2010 18:34:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-Import-Excel-get-column-names-from-different-range/m-p/51089#M13967</guid>
      <dc:creator>fredbell</dc:creator>
      <dc:date>2010-12-16T18:34:11Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Import Excel</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-Import-Excel-get-column-names-from-different-range/m-p/51090#M13968</link>
      <description>Do you mean that the variable names are in one range say row three (say a3:aw3), while the data is in another location on the sheet say b40:ax90?</description>
      <pubDate>Thu, 16 Dec 2010 19:21:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-Import-Excel-get-column-names-from-different-range/m-p/51090#M13968</guid>
      <dc:creator>ArtC</dc:creator>
      <dc:date>2010-12-16T19:21:47Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Import Excel</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-Import-Excel-get-column-names-from-different-range/m-p/51091#M13969</link>
      <description>Yes that is what i mean, thanks.&lt;BR /&gt;
&lt;BR /&gt;
Fred</description>
      <pubDate>Thu, 16 Dec 2010 19:39:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-Import-Excel-get-column-names-from-different-range/m-p/51091#M13969</guid>
      <dc:creator>fredbell</dc:creator>
      <dc:date>2010-12-16T19:39:25Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Import Excel: get column names from different range</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-Import-Excel-get-column-names-from-different-range/m-p/51092#M13970</link>
      <description>&lt;P&gt;&lt;EM&gt;Editor's note: this is a popular topic. &amp;nbsp;We've consolidated the best responses in this one Accepted Solution.&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;From&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13683"&gt;@ArtC&lt;/a&gt;, answering for the case where the field names are contiguous with the data range.&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;SPAN&gt;You are very close. Change your range to include the row with the variable names.&lt;/SPAN&gt;&lt;BR /&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;From&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/18381"&gt;@rsva&lt;/a&gt;, using the legacy DBMS=XLS method, which supports NAMEROW=:&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BR /&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;Proc import datafile="xx.xls"
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; dbms=xls replace out=newdata;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; getnames=yes;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; namerow=3;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; datarow=4;
Run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;EM&gt;And from&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13711"&gt;@art297&lt;/a&gt;:&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Fred,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If the column names are in a completely different (non-contiguous) part of the sheet, then perhaps you need a two-pass approach. &amp;nbsp;One way might be to import the variable names and the data separately. E.g.:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;PROC IMPORT OUT= WORK.TEST1
DATAFILE= "c:\xltest.xls"
DBMS=EXCEL2000 REPLACE;
RANGE="A2:C2";
GETNAMES=YES;
RUN;

proc sql noprint;
select catt('F',varnum,'=',name)
into :recodes
separated by ' '
from sashelp.vcolumn
where libname="WORK"
and memname="TEST1"
;
quit;

PROC IMPORT OUT= WORK.TEST2
DATAFILE= "c:\xltest.xls"
DBMS=EXCEL REPLACE;
RANGE="A15:C17";
GETNAMES=NO;
RUN;

data want;
set test2 (rename=(&amp;amp;recodes.));
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;HTH,&lt;BR /&gt; Art&lt;/P&gt;</description>
      <pubDate>Wed, 26 Apr 2017 12:03:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-Import-Excel-get-column-names-from-different-range/m-p/51092#M13970</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2017-04-26T12:03:32Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Import Excel</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-Import-Excel-get-column-names-from-different-range/m-p/51093#M13971</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; Try this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Proc import datafile="xx.xls"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; dbms=xls replace out=newdata;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; getnames=yes;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; namerow=3;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; datarow=4;&lt;/P&gt;&lt;P&gt;Run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 27 Jul 2011 17:35:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-Import-Excel-get-column-names-from-different-range/m-p/51093#M13971</guid>
      <dc:creator>rsva</dc:creator>
      <dc:date>2011-07-27T17:35:35Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Import Excel: get column names from different range</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-Import-Excel-get-column-names-from-different-range/m-p/356952#M64265</link>
      <description>&lt;P&gt;Hi, I am using SAS9.3. The above code is importing a maximum of 142 columns. Please help. - Thanks in advance.&lt;/P&gt;</description>
      <pubDate>Mon, 08 May 2017 17:28:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-Import-Excel-get-column-names-from-different-range/m-p/356952#M64265</guid>
      <dc:creator>soumoboxi</dc:creator>
      <dc:date>2017-05-08T17:28:46Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Import Excel: get column names from different range</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-Import-Excel-get-column-names-from-different-range/m-p/356958#M64266</link>
      <description>&lt;P&gt;I think you'll need to provide more details about your Excel file and your code/log...or alternatively, work with SAS Tech Support on your specific case.&lt;/P&gt;</description>
      <pubDate>Mon, 08 May 2017 17:46:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-Import-Excel-get-column-names-from-different-range/m-p/356958#M64266</guid>
      <dc:creator>ChrisHemedinger</dc:creator>
      <dc:date>2017-05-08T17:46:37Z</dc:date>
    </item>
  </channel>
</rss>

