<?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: Get the sheet names list from Excel with name too long (&amp;gt;30 char) in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Get-the-sheet-names-list-from-Excel-with-name-too-long-gt-30/m-p/384230#M91724</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It's possible to have sheetnames &amp;gt; 32 chars.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;See this error message.&lt;/P&gt;&lt;P&gt;&lt;A href="http://support.sas.com/kb/45/801.html" target="_blank"&gt;http://support.sas.com/kb/45/801.html&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I found a solution,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I used this VBA code to reduce sheet names by 2 letters :&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;Sub removeLetters()
Dim WS As Worksheet
For Each WS In Sheets
   WS.Name = Left(WS.Name, Len(WS.Name) - 2)
Next WS
End Sub&lt;/PRE&gt;&lt;P&gt;Then the import completly worked with all the sheets appearing in the library.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Tom&lt;/P&gt;</description>
    <pubDate>Mon, 31 Jul 2017 12:00:21 GMT</pubDate>
    <dc:creator>thogerar1</dc:creator>
    <dc:date>2017-07-31T12:00:21Z</dc:date>
    <item>
      <title>Get the sheet names list from Excel with name too long (&gt;30 char)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Get-the-sheet-names-list-from-Excel-with-name-too-long-gt-30/m-p/384203#M91713</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm wondering if it is possible to get the list of sheet names from an excel.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It's possible here with valide sheet name :&lt;/P&gt;&lt;P&gt;&lt;A href="https://communities.sas.com/t5/Base-SAS-Programming/Query-excel-to-find-sheet-name/m-p/45477/highlight/true#M9403" target="_blank"&gt;https://communities.sas.com/t5/Base-SAS-Programming/Query-excel-to-find-sheet-name/m-p/45477/highlight/true#M9403&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tested it, it worked.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But my sheet names have more than 30 characters.&lt;/P&gt;&lt;P&gt;The sheet names will change every week.&lt;/P&gt;&lt;P&gt;The excel can contains 20 or 40 sheets per week.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Do you know if it's possible to get the list from the excel ?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If I import the excel, only valide name or shown.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I can read the long name sheet like this :&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;PROC SQL;&lt;BR /&gt;CONNECT TO EXCEL (PATH='H:\desktop\myexcel.xls');&lt;BR /&gt;SELECT * FROM CONNECTION TO EXCEL&lt;BR /&gt;(SELECT * FROM `loulou.xarpiegewaar@vnpcccparizzz`&lt;BR /&gt;DISCONNECT FROM EXCEL;&lt;BR /&gt;QUIT;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But I cannot get the entire list of sheets somewhere like in a macro variable or a data set.&lt;/P&gt;&lt;P&gt;even from SASHELP.VSTABVW or&amp;nbsp;sashelp.vtable&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks by advance,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Tom&lt;/P&gt;</description>
      <pubDate>Mon, 31 Jul 2017 10:40:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Get-the-sheet-names-list-from-Excel-with-name-too-long-gt-30/m-p/384203#M91713</guid>
      <dc:creator>thogerar1</dc:creator>
      <dc:date>2017-07-31T10:40:22Z</dc:date>
    </item>
    <item>
      <title>Re: Get the sheet names list from Excel with name too long (&gt;30 char)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Get-the-sheet-names-list-from-Excel-with-name-too-long-gt-30/m-p/384218#M91720</link>
      <description>&lt;P&gt;LIbname excel should create a libname which you can look at for sheet names (i.e. from the sashelp vtable view). &amp;nbsp;I would question however, how you get sheet names with more than 31 characters as its not possible through the UI of Excel. &amp;nbsp;Also, if the file keeps changing, diff sheets etc. how you aim to handle using the file anyways.&lt;/P&gt;</description>
      <pubDate>Mon, 31 Jul 2017 11:13:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Get-the-sheet-names-list-from-Excel-with-name-too-long-gt-30/m-p/384218#M91720</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2017-07-31T11:13:33Z</dc:date>
    </item>
    <item>
      <title>Re: Get the sheet names list from Excel with name too long (&gt;30 char)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Get-the-sheet-names-list-from-Excel-with-name-too-long-gt-30/m-p/384230#M91724</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It's possible to have sheetnames &amp;gt; 32 chars.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;See this error message.&lt;/P&gt;&lt;P&gt;&lt;A href="http://support.sas.com/kb/45/801.html" target="_blank"&gt;http://support.sas.com/kb/45/801.html&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I found a solution,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I used this VBA code to reduce sheet names by 2 letters :&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;Sub removeLetters()
Dim WS As Worksheet
For Each WS In Sheets
   WS.Name = Left(WS.Name, Len(WS.Name) - 2)
Next WS
End Sub&lt;/PRE&gt;&lt;P&gt;Then the import completly worked with all the sheets appearing in the library.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Tom&lt;/P&gt;</description>
      <pubDate>Mon, 31 Jul 2017 12:00:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Get-the-sheet-names-list-from-Excel-with-name-too-long-gt-30/m-p/384230#M91724</guid>
      <dc:creator>thogerar1</dc:creator>
      <dc:date>2017-07-31T12:00:21Z</dc:date>
    </item>
    <item>
      <title>Re: Get the sheet names list from Excel with name too long (&gt;30 char)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Get-the-sheet-names-list-from-Excel-with-name-too-long-gt-30/m-p/384233#M91725</link>
      <description>&lt;P&gt;Ah yes adding the $ does make it 32. &amp;nbsp;if you are happy with using VBA, then you could simplfy your process by using VBA to create a CSV file of all the data, do loop over sheets in workbook, then for each dump out the data to a text file separated by commas, and have another column for sheet name. &amp;nbsp;I.e. you then get one CSV file with all the data and sheetname as a column. &amp;nbsp;Avoids fidlly programming in SAS and simplfies your import code to only be one datastep read CSV.&lt;/P&gt;</description>
      <pubDate>Mon, 31 Jul 2017 12:04:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Get-the-sheet-names-list-from-Excel-with-name-too-long-gt-30/m-p/384233#M91725</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2017-07-31T12:04:46Z</dc:date>
    </item>
  </channel>
</rss>

