<?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: How to rename a table in the libraries? in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-to-rename-a-table-in-the-libraries/m-p/918476#M361799</link>
    <description>&lt;P&gt;No i'd like to change the name from Sheet1 to something else.&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 29 Feb 2024 19:38:06 GMT</pubDate>
    <dc:creator>Mluna</dc:creator>
    <dc:date>2024-02-29T19:38:06Z</dc:date>
    <item>
      <title>How to rename a table in the libraries?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-rename-a-table-in-the-libraries/m-p/918450#M361786</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I just started learning SAS. I made a library using the code:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;%let path2=~/MOP/myData/Testing.xlsx;&lt;BR /&gt;options validvarname=v7 ;&lt;BR /&gt;libname SAMPLIB XLSX "&amp;amp;path2";&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But the excel file sheet is named &lt;STRONG&gt;Sheet1&lt;/STRONG&gt;. I know I can go rename the Sheet name in excel and re-run it.&lt;/P&gt;&lt;P&gt;But that created a couple of questions: can just rename the Sheets by adding an option in the code? and can i rename multiple sheets?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you to anyone that could point me in the right direction. I tried looking it through the documentation but I'm having a hard time finding an answer.&lt;/P&gt;</description>
      <pubDate>Thu, 29 Feb 2024 17:42:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-rename-a-table-in-the-libraries/m-p/918450#M361786</guid>
      <dc:creator>Mluna</dc:creator>
      <dc:date>2024-02-29T17:42:31Z</dc:date>
    </item>
    <item>
      <title>Re: How to rename a table in the libraries?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-rename-a-table-in-the-libraries/m-p/918452#M361788</link>
      <description>&lt;P&gt;I'm not 100% sure I understand what you are asking, but ...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;how about this?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let path2=Testing.xlsx;
options validvarname=v7 ;
libname SAMPLIB XLSX "&amp;amp;path2";

data samplib.Class;
    set sashelp.class;
run;
libname samplib;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 29 Feb 2024 17:51:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-rename-a-table-in-the-libraries/m-p/918452#M361788</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2024-02-29T17:51:56Z</dc:date>
    </item>
    <item>
      <title>Re: How to rename a table in the libraries?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-rename-a-table-in-the-libraries/m-p/918470#M361795</link>
      <description>&lt;P&gt;So when I Run the code I posted it created that library and the xlsx file has only one sheet, named Sheet1, I want to know if you can change the name of that sheet from the code, so it doesn't just use the default name of the sheet from the xlsx file.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Mluna_0-1709233910813.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/94265i92F2436F95AEBBDB/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Mluna_0-1709233910813.png" alt="Mluna_0-1709233910813.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 29 Feb 2024 19:13:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-rename-a-table-in-the-libraries/m-p/918470#M361795</guid>
      <dc:creator>Mluna</dc:creator>
      <dc:date>2024-02-29T19:13:51Z</dc:date>
    </item>
    <item>
      <title>Re: How to rename a table in the libraries?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-rename-a-table-in-the-libraries/m-p/918474#M361798</link>
      <description>&lt;P&gt;You want a blank tab named something other than SHEET1?&lt;/P&gt;</description>
      <pubDate>Thu, 29 Feb 2024 19:35:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-rename-a-table-in-the-libraries/m-p/918474#M361798</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2024-02-29T19:35:01Z</dc:date>
    </item>
    <item>
      <title>Re: How to rename a table in the libraries?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-rename-a-table-in-the-libraries/m-p/918476#M361799</link>
      <description>&lt;P&gt;No i'd like to change the name from Sheet1 to something else.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 29 Feb 2024 19:38:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-rename-a-table-in-the-libraries/m-p/918476#M361799</guid>
      <dc:creator>Mluna</dc:creator>
      <dc:date>2024-02-29T19:38:06Z</dc:date>
    </item>
    <item>
      <title>Re: How to rename a table in the libraries?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-rename-a-table-in-the-libraries/m-p/918481#M361800</link>
      <description>&lt;P&gt;The job of the library statement is to create a libref (in your case SAMPLIB) which points to a logical location that holds tables.&amp;nbsp; That location could be a SQL server database, or a folder, or many other things.&amp;nbsp; In your case, the location is an Excel file, that likely has one or more sheets.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The screen shot is showing the names of all of the sheets that exist in the Excel file.&amp;nbsp; If you want to change the names of those sheets, you would need to update the Excel file.&amp;nbsp; (I can't remember if you can do this from SAS, but regardless, you would be changing the Excel file.)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Typically I don't worry about the names of the sheets in the Excel file (which is often Sheet1, because 95% of Excel users don't even know that an Excel file can have multiple sheets in it), but I will give the data a better name when I read the data into a SAS dataset.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So my step to read the data into SAS might look like:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let path2=~/MOP/myData/Testing.xlsx;
options validvarname=v7 ;
libname SAMPLIB XLSX "&amp;amp;path2";

data Testing;
  set samplib.Sheet1;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;That will create a SAS dataset named TESTING, in the WORK library, which has the data from Sheet1 in Testing.xls.&lt;/P&gt;</description>
      <pubDate>Thu, 29 Feb 2024 19:51:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-rename-a-table-in-the-libraries/m-p/918481#M361800</guid>
      <dc:creator>Quentin</dc:creator>
      <dc:date>2024-02-29T19:51:38Z</dc:date>
    </item>
    <item>
      <title>Re: How to rename a table in the libraries?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-rename-a-table-in-the-libraries/m-p/918484#M361802</link>
      <description>Thank you. What you said makes sense. Instead of working direct from the library table you can just create a table and name it w/e you want. I wasn't sure what the connection was when creating the libref. But this made sense.</description>
      <pubDate>Thu, 29 Feb 2024 19:56:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-rename-a-table-in-the-libraries/m-p/918484#M361802</guid>
      <dc:creator>Mluna</dc:creator>
      <dc:date>2024-02-29T19:56:26Z</dc:date>
    </item>
    <item>
      <title>Re: How to rename a table in the libraries?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-rename-a-table-in-the-libraries/m-p/918514#M361807</link>
      <description>&lt;P&gt;Libraries that point to most external data sources, such as Excel, are not going to have the "rename" ability&amp;nbsp; that SAS does use for it's files because you never know what else may be looking for that explicit name and SAS renaming the "table" would break other behaviors.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For example you can reference a cell on a different sheet inside an Excel workbook by using "Some sheet name"!A4 to reference the cell A4 on the sheet with name "Some sheet name". If you were allowed to rename that sheet then the cell reference would break and other parts of the spreadsheet would be unusable.&lt;/P&gt;</description>
      <pubDate>Thu, 29 Feb 2024 23:00:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-rename-a-table-in-the-libraries/m-p/918514#M361807</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2024-02-29T23:00:33Z</dc:date>
    </item>
  </channel>
</rss>

