<?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 Excel to SAS in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Excel-to-SAS/m-p/28049#M5161</link>
    <description>If there are multiple worksheets for each month, How to select the worksheet based on the year month in the filename.&lt;BR /&gt;
For instance, my input file National Cornerstone 2009 09.xls,has worksheets from Jan to sep with naming convention as Jan 2009 to Sep 2009.How to select Sep 2009 worksheet?&lt;BR /&gt;
&lt;BR /&gt;
and for National Cornerstone 2009 09.xls, how to select Oct 2009 worksheet?&lt;BR /&gt;
To give heads up I use the following code:&lt;BR /&gt;
&lt;BR /&gt;
proc sql;&lt;BR /&gt;
 connect to excel (path="&amp;amp;inpt.\National Cornerstone 2009 09.xls");&lt;BR /&gt;
   create table tabnaes as &lt;BR /&gt;
        select table_name from connection to excel (jet::tables);&lt;BR /&gt;
  quit;&lt;BR /&gt;
&lt;BR /&gt;
The table tabnaes will have all the worksheet names.The only way is to hardcode the woksheet names to delete as shown below.&lt;BR /&gt;
proc sql;&lt;BR /&gt;
 delete from tabnaes where  table_name like '%FEIBA%' or table_name like '%$%';&lt;BR /&gt;
 select table_name into:wksht  from tabnaes;&lt;BR /&gt;
 quit;&lt;BR /&gt;
 %let wksht = %trim(&amp;amp;wksht);&lt;BR /&gt;
 %put   &amp;amp;wksht.;</description>
    <pubDate>Wed, 09 Dec 2009 18:56:42 GMT</pubDate>
    <dc:creator>SASPhile</dc:creator>
    <dc:date>2009-12-09T18:56:42Z</dc:date>
    <item>
      <title>Excel to SAS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Excel-to-SAS/m-p/28049#M5161</link>
      <description>If there are multiple worksheets for each month, How to select the worksheet based on the year month in the filename.&lt;BR /&gt;
For instance, my input file National Cornerstone 2009 09.xls,has worksheets from Jan to sep with naming convention as Jan 2009 to Sep 2009.How to select Sep 2009 worksheet?&lt;BR /&gt;
&lt;BR /&gt;
and for National Cornerstone 2009 09.xls, how to select Oct 2009 worksheet?&lt;BR /&gt;
To give heads up I use the following code:&lt;BR /&gt;
&lt;BR /&gt;
proc sql;&lt;BR /&gt;
 connect to excel (path="&amp;amp;inpt.\National Cornerstone 2009 09.xls");&lt;BR /&gt;
   create table tabnaes as &lt;BR /&gt;
        select table_name from connection to excel (jet::tables);&lt;BR /&gt;
  quit;&lt;BR /&gt;
&lt;BR /&gt;
The table tabnaes will have all the worksheet names.The only way is to hardcode the woksheet names to delete as shown below.&lt;BR /&gt;
proc sql;&lt;BR /&gt;
 delete from tabnaes where  table_name like '%FEIBA%' or table_name like '%$%';&lt;BR /&gt;
 select table_name into:wksht  from tabnaes;&lt;BR /&gt;
 quit;&lt;BR /&gt;
 %let wksht = %trim(&amp;amp;wksht);&lt;BR /&gt;
 %put   &amp;amp;wksht.;</description>
      <pubDate>Wed, 09 Dec 2009 18:56:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Excel-to-SAS/m-p/28049#M5161</guid>
      <dc:creator>SASPhile</dc:creator>
      <dc:date>2009-12-09T18:56:42Z</dc:date>
    </item>
    <item>
      <title>Re: Excel to SAS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Excel-to-SAS/m-p/28050#M5162</link>
      <description>Hi:&lt;BR /&gt;
  If you were using the LIBNAME engine connection to Excel, I'd recommend these:&lt;BR /&gt;
&lt;A href="http://www2.sas.com/proceedings/sugi31/034-31.pdf" target="_blank"&gt;http://www2.sas.com/proceedings/sugi31/034-31.pdf&lt;/A&gt;&lt;BR /&gt;
&lt;A href="http://www2.sas.com/proceedings/sugi31/024-31.pdf" target="_blank"&gt;http://www2.sas.com/proceedings/sugi31/024-31.pdf&lt;/A&gt;&lt;BR /&gt;
 &lt;BR /&gt;
because both papers have good information about naming conventions. &lt;BR /&gt;
 &lt;BR /&gt;
I do not know whether the other methods (JET/ ODBC/OLE-DB) use the same sheetname methods as the LIBNAME engine. This might be a question for Tech Support, if you do not get any other suggestions from forum participants.&lt;BR /&gt;
 &lt;BR /&gt;
cynthia</description>
      <pubDate>Wed, 09 Dec 2009 19:25:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Excel-to-SAS/m-p/28050#M5162</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2009-12-09T19:25:07Z</dc:date>
    </item>
  </channel>
</rss>

