<?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 From Excel Table in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Proc-Import-From-Excel-Table/m-p/906364#M357888</link>
    <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/100491"&gt;@GeorgeBonanza&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Thanks so much.&amp;nbsp; This is a very creative solution.&amp;nbsp; Is this essentially what proc import is doing behind the scenes when importing a sheet or named range from Excel?&amp;nbsp; If so, is there a way to modify the code so that it reads the XML from code run on a SAS server similar to how I'd modify a proc import by adding serveruser=;&amp;nbsp; serverpass=;&amp;nbsp;server=; port=; ?&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;No.&lt;/P&gt;
&lt;P&gt;You will need to have access to the file directly.&lt;/P&gt;
&lt;P&gt;What you are talking about is using SAS PC FILES server to access the file.&amp;nbsp; That does not even work with the XLSX engine.&amp;nbsp; I think that only works using the Windows supplied tools that the EXCEL engine uses.&lt;/P&gt;</description>
    <pubDate>Tue, 05 Dec 2023 23:31:46 GMT</pubDate>
    <dc:creator>Tom</dc:creator>
    <dc:date>2023-12-05T23:31:46Z</dc:date>
    <item>
      <title>Proc Import From Excel Table</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-Import-From-Excel-Table/m-p/906302#M357858</link>
      <description>&lt;P&gt;Is it possible to import an Excel Table into SAS using Proc Import?&amp;nbsp; In Excel, the table has a name, in this case it's "TBL", and appears in the Name Manager.&amp;nbsp; However, the range associated with "TBL" does not contain the header row which contains the variable names.&amp;nbsp; I've tried using "range=" since this works with named ranges but it does not appear to work with tables. The table is in a sheet with other data, pivot tables, graphs, etc. so "sheet=" will not work. Any insight is appreciated.&amp;nbsp; Thanks in advance.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc import out= WANT
	datafile= "C:\ExcelFile.xlsm"
	dbms= EXCEL replace;
	range= "TBL";
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 05 Dec 2023 18:48:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-Import-From-Excel-Table/m-p/906302#M357858</guid>
      <dc:creator>GeorgeBonanza</dc:creator>
      <dc:date>2023-12-05T18:48:10Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Import From Excel Table</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-Import-From-Excel-Table/m-p/906308#M357862</link>
      <description>&lt;P&gt;Use &lt;A href="https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/proc/p18y8iz67dpzk7n1m765owrkhqou.htm" target="_self"&gt;GETNAMES=YES&lt;/A&gt; statement to import variable names from the source data.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc import out= WANT
	datafile= "C:\ExcelFile.xls"
	dbms= EXCEL replace;
	getnames= yes;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 05 Dec 2023 19:07:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-Import-From-Excel-Table/m-p/906308#M357862</guid>
      <dc:creator>A_Kh</dc:creator>
      <dc:date>2023-12-05T19:07:24Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Import From Excel Table</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-Import-From-Excel-Table/m-p/906317#M357865</link>
      <description>I appreciate you taking the time to respond but this isn't really the crux of my question.  Perhaps I should have phrased the question differently.  Using Proc Import, is there a way to refer to a table in Excel the same way you would refer to a sheet using "sheet=" or a named range using "range="?  Essentially, is there something equivalent to "table="?</description>
      <pubDate>Tue, 05 Dec 2023 19:56:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-Import-From-Excel-Table/m-p/906317#M357865</guid>
      <dc:creator>GeorgeBonanza</dc:creator>
      <dc:date>2023-12-05T19:56:42Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Import From Excel Table</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-Import-From-Excel-Table/m-p/906319#M357866</link>
      <description>&lt;P&gt;So they made a named range that does not include the header row?&lt;/P&gt;
&lt;P&gt;You can use the actual cell names instead.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc import 
  dbms=xlsx 
  file='myfile.xlsx'
  out=want replace
;
  range='mysheet$A12:B27';
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;But unless you examine the individual XML files in the XLSX file (or in your case it looks like you have an XLSM file) it will be hard to programmatically determine where to find the name row.&lt;/P&gt;</description>
      <pubDate>Tue, 05 Dec 2023 20:07:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-Import-From-Excel-Table/m-p/906319#M357866</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2023-12-05T20:07:20Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Import From Excel Table</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-Import-From-Excel-Table/m-p/906322#M357867</link>
      <description>&lt;P&gt;It's something slightly different than a named range. It's a table (you create it by selecting your data in Excel and pressing ctrl + T). When you look at it in the Name Manager it has a "Name" and "Refers To" range just like a named range would but the "Refers To" cells only reference the body of the table without the headers.&amp;nbsp; It's preferable to a named range in that the range expands automatically when new data is added. (there are ways to make named ranges dynamic but this allows other functionality as well).&amp;nbsp; I suppose what I would need is something like "table=" instead of "range=" but I don't see that as an option.&amp;nbsp;&amp;nbsp;Thanks for taking the time to respond.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 05 Dec 2023 20:26:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-Import-From-Excel-Table/m-p/906322#M357867</guid>
      <dc:creator>GeorgeBonanza</dc:creator>
      <dc:date>2023-12-05T20:26:48Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Import From Excel Table</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-Import-From-Excel-Table/m-p/906325#M357869</link>
      <description>&lt;P&gt;So read it from the XML.&lt;/P&gt;
&lt;PRE&gt;1    data test;
2      infile 'c:\downloads\tables.xlsx' zip member='xl/tables/table1.xml' recfm=n dsd dlm=' ';
3      input @ 'ref=' ref :$50.;
4      call symputx('ref',ref);
5      stop;
6    run;

NOTE: The infile 'c:\downloads\tables.xlsx' is:
      (system-specific pathname),
      (system-specific file attributes)

NOTE: 1 record was read from the infile (system-specific pathname).
NOTE: The data set WORK.TEST has 0 observations and 1 variables.
NOTE: DATA statement used (Total process time):
      real time           0.01 seconds
      cpu time            0.01 seconds


7
8    %put &amp;amp;=ref;
REF=A2:C4
&lt;/PRE&gt;</description>
      <pubDate>Tue, 05 Dec 2023 20:55:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-Import-From-Excel-Table/m-p/906325#M357869</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2023-12-05T20:55:48Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Import From Excel Table</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-Import-From-Excel-Table/m-p/906337#M357878</link>
      <description>&lt;P&gt;Thanks so much.&amp;nbsp; This is a very creative solution.&amp;nbsp; Is this essentially what proc import is doing behind the scenes when importing a sheet or named range from Excel?&amp;nbsp; If so, is there a way to modify the code so that it reads the XML from code run on a SAS server similar to how I'd modify a proc import by adding serveruser=;&amp;nbsp; serverpass=;&amp;nbsp;server=; port=; ?&lt;/P&gt;</description>
      <pubDate>Tue, 05 Dec 2023 21:27:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-Import-From-Excel-Table/m-p/906337#M357878</guid>
      <dc:creator>GeorgeBonanza</dc:creator>
      <dc:date>2023-12-05T21:27:47Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Import From Excel Table</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-Import-From-Excel-Table/m-p/906364#M357888</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/100491"&gt;@GeorgeBonanza&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Thanks so much.&amp;nbsp; This is a very creative solution.&amp;nbsp; Is this essentially what proc import is doing behind the scenes when importing a sheet or named range from Excel?&amp;nbsp; If so, is there a way to modify the code so that it reads the XML from code run on a SAS server similar to how I'd modify a proc import by adding serveruser=;&amp;nbsp; serverpass=;&amp;nbsp;server=; port=; ?&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;No.&lt;/P&gt;
&lt;P&gt;You will need to have access to the file directly.&lt;/P&gt;
&lt;P&gt;What you are talking about is using SAS PC FILES server to access the file.&amp;nbsp; That does not even work with the XLSX engine.&amp;nbsp; I think that only works using the Windows supplied tools that the EXCEL engine uses.&lt;/P&gt;</description>
      <pubDate>Tue, 05 Dec 2023 23:31:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-Import-From-Excel-Table/m-p/906364#M357888</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2023-12-05T23:31:46Z</dc:date>
    </item>
  </channel>
</rss>

