<?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: Libname is created but the proc Contents doesnt recognize the worksheet name in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Libname-is-created-but-the-proc-Contents-doesnt-recognize-the/m-p/788011#M81378</link>
    <description>&lt;P&gt;Whenever I'm unsure about how an engine will deal with Excel sheet names, I run:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;proc contents data=npd._ALL_;
run;&lt;/PRE&gt;
&lt;P&gt;Early in the output, it will give you a list of the table names (translated sheet names) it sees, followed by the typical CONTENTS output for each table.&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sat, 01 Jan 2022 23:37:41 GMT</pubDate>
    <dc:creator>Quentin</dc:creator>
    <dc:date>2022-01-01T23:37:41Z</dc:date>
    <item>
      <title>Libname is created but the proc Contents doesnt recognize the worksheet name</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Libname-is-created-but-the-proc-Contents-doesnt-recognize-the/m-p/788003#M81373</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;The library was created successfully with the following tables:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;parks$&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;species$&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;species$_xlnm#_FilterDatabase&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;visits$&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;This is the code i used to create the libname, but it gets an error reading the contents due to the "$" in the table name.&amp;nbsp; &amp;nbsp;I have removed the $ from the code to not include the $ and i still get an error:&amp;nbsp;&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;ERROR:&amp;nbsp; File NPD.parks.DATA does not exist.&amp;nbsp; Has anyone received this issue?&amp;nbsp; How an I get past this issue?&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;BR /&gt;libname npd "S:/Workshop/EPG1V2/data/np_info.xlsx"
options validvarname=v7;
proc contents data=npd.parks$;
run;
libname npd clear;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 01 Jan 2022 21:27:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Libname-is-created-but-the-proc-Contents-doesnt-recognize-the/m-p/788003#M81373</guid>
      <dc:creator>java1982</dc:creator>
      <dc:date>2022-01-01T21:27:55Z</dc:date>
    </item>
    <item>
      <title>Re: Libname is created but the proc Contents doesnt recognize the worksheet name</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Libname-is-created-but-the-proc-Contents-doesnt-recognize-the/m-p/788005#M81375</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you do not specify a libname engine, the libname engine is 'V9'.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You need an&amp;nbsp;&lt;SPAN class="xisDoc-selection"&gt;&lt;FONT&gt;EXCEL&lt;/FONT&gt; &lt;FONT&gt;LIBNAME&lt;/FONT&gt; &lt;FONT&gt;engine.&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="xisDoc-selection"&gt;&lt;FONT&gt;Something like&amp;nbsp;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;PRE class="xisDoc-codeFragment"&gt;&lt;CODE class="language-sas"&gt;&lt;FONT&gt;libname&lt;/FONT&gt; xdb &lt;FONT&gt;excel&lt;/FONT&gt; "\\mydriver\pcfdata\Invoice.xlsx";
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;or&lt;/P&gt;
&lt;PRE class="xisDoc-codeFragment"&gt;&lt;CODE class="language-sas"&gt;&lt;FONT&gt;libname&lt;/FONT&gt; myhr XLSX "/usr/wolfen/benefits/HRworkbook.xlsx";
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Good luck,&lt;/P&gt;
&lt;P&gt;Koen&lt;/P&gt;</description>
      <pubDate>Sat, 01 Jan 2022 21:36:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Libname-is-created-but-the-proc-Contents-doesnt-recognize-the/m-p/788005#M81375</guid>
      <dc:creator>sbxkoenk</dc:creator>
      <dc:date>2022-01-01T21:36:18Z</dc:date>
    </item>
    <item>
      <title>Re: Libname is created but the proc Contents doesnt recognize the worksheet name</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Libname-is-created-but-the-proc-Contents-doesnt-recognize-the/m-p/788006#M81376</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;libname npd "S:/Workshop/EPG1V2/data/np_info.xlsx"
options validvarname=v7;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;This code will result in a syntax error because of the missing semicolon for the LIBNAME statement.&lt;/P&gt;
&lt;P&gt;Anyway, your LIBNAME cannot work because it tries to assign a &lt;EM&gt;V9 Base&lt;/EM&gt; library to an&amp;nbsp;&lt;EM&gt;Excel file&lt;/EM&gt;. This is because you did not include the XLSX engine option like this:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;libname npd xlsx "S:\Workshop\EPG1V2\data\np_info.xlsx";&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;(forward slashes changed to backward because of Windows)&lt;/P&gt;</description>
      <pubDate>Sat, 01 Jan 2022 21:39:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Libname-is-created-but-the-proc-Contents-doesnt-recognize-the/m-p/788006#M81376</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2022-01-01T21:39:42Z</dc:date>
    </item>
    <item>
      <title>Re: Libname is created but the proc Contents doesnt recognize the worksheet name</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Libname-is-created-but-the-proc-Contents-doesnt-recognize-the/m-p/788009#M81377</link>
      <description>&lt;P&gt;Since you didn't tell it what database engine to use it will default to EXCEL because you pointed the libref at an XLSX file.&lt;/P&gt;
&lt;P&gt;Try using XLSX engine instead.&lt;/P&gt;
&lt;P&gt;Try copying all of the sheets and see what it finds.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;libname npd xlsx "S:\Workshop\EPG1V2\data\np_info.xlsx";
proc copy inlib=npd outlib=work;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;If that doesn't solve it try using a name literal for your range references.&amp;nbsp; Note you probably will need to set the VALIDMEMNAME=EXTEND option first.&lt;/P&gt;
&lt;PRE&gt;options validmemname=extend;&lt;BR /&gt;&lt;CODE class=" language-sas"&gt;data parks;&lt;BR /&gt;  set npd."'parks$'"n;&lt;BR /&gt;run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 01 Jan 2022 22:46:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Libname-is-created-but-the-proc-Contents-doesnt-recognize-the/m-p/788009#M81377</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2022-01-01T22:46:07Z</dc:date>
    </item>
    <item>
      <title>Re: Libname is created but the proc Contents doesnt recognize the worksheet name</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Libname-is-created-but-the-proc-Contents-doesnt-recognize-the/m-p/788011#M81378</link>
      <description>&lt;P&gt;Whenever I'm unsure about how an engine will deal with Excel sheet names, I run:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;proc contents data=npd._ALL_;
run;&lt;/PRE&gt;
&lt;P&gt;Early in the output, it will give you a list of the table names (translated sheet names) it sees, followed by the typical CONTENTS output for each table.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 01 Jan 2022 23:37:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Libname-is-created-but-the-proc-Contents-doesnt-recognize-the/m-p/788011#M81378</guid>
      <dc:creator>Quentin</dc:creator>
      <dc:date>2022-01-01T23:37:41Z</dc:date>
    </item>
    <item>
      <title>Re: Libname is created but the proc Contents doesnt recognize the worksheet name</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Libname-is-created-but-the-proc-Contents-doesnt-recognize-the/m-p/788015#M81379</link>
      <description>&lt;P&gt;Hi:&lt;/P&gt;
&lt;P&gt;&amp;nbsp; It looks like you're working in the Programming 1 e-learning course. The syntax you show is not exactly the syntax that we recommend in Lesson 2.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; I believe that if you review the videos in the class, you'll see that we frequently use "S:\workshop" as an example drive location. However, you ONLY have that location for the data if you are using the Virtual Lab in the e-learning class or if you are taking a Live Web version of the class and using the Classroom lab image.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; We recommend that you explicitly use the XLSX engine in the LIBNAME statement and that is the syntax that we show in the activity program that you use as the starter file for this task:&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;libname np xlsx "s:/workshop/data/np_info.xlsx";&amp;nbsp; &amp;lt;-- classroom example&lt;BR /&gt;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;Some alternate LIBNAME statements on other systems might be:&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;libname np xlsx "~/EPG1V2/data/np_info.xlsx";&amp;nbsp; &amp;lt;-- SAS OnDemand for Academics example&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;libname np xlsx "c:\SAS_Class]EPG1V2\data\np_info.xlsx";&amp;nbsp; &amp;lt;-- local C: drive example&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; I would recommend following the appropriate LIBNAME statement with an exploratory PROC CONTENTS step:&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;options validvarname=v7;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;proc contents data=np._all_ nods;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;run;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;This would show you the names of the worksheets. If you use the XLSX engine to read the data, you should not need to put a $ after the sheet name. In fact, when I run the above code, this is what I see in the PROC CONTENTS output:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Cynthia_sas_0-1641091532438.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/67063i4F1B647441CD8D6F/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Cynthia_sas_0-1641091532438.png" alt="Cynthia_sas_0-1641091532438.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;(Notice that I used a different C: drive location on my work machine to point to the full path to the XLSX file). Now that I've done that, I&amp;nbsp; can submit modified code to see just the contents for the PARKS sheet:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Cynthia_sas_1-1641091727123.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/67064iDACE6C33BDDDD828/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Cynthia_sas_1-1641091727123.png" alt="Cynthia_sas_1-1641091727123.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; So, as you can see, without using the $ in the DATA= option and pointing to the location of the XLSX file correctly for my method of using SAS, I was able to run this activity in the class.&lt;/P&gt;
&lt;P&gt;Cynthia&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 02 Jan 2022 02:49:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Libname-is-created-but-the-proc-Contents-doesnt-recognize-the/m-p/788015#M81379</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2022-01-02T02:49:58Z</dc:date>
    </item>
    <item>
      <title>Re: Libname is created but the proc Contents doesnt recognize the worksheet name</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Libname-is-created-but-the-proc-Contents-doesnt-recognize-the/m-p/788034#M81380</link>
      <description>Thank you so much for this tip/trick! Its amazing will definitely keep this in my daily usage. &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; Awesome!</description>
      <pubDate>Sun, 02 Jan 2022 18:34:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Libname-is-created-but-the-proc-Contents-doesnt-recognize-the/m-p/788034#M81380</guid>
      <dc:creator>java1982</dc:creator>
      <dc:date>2022-01-02T18:34:44Z</dc:date>
    </item>
    <item>
      <title>Re: Libname is created but the proc Contents doesnt recognize the worksheet name</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Libname-is-created-but-the-proc-Contents-doesnt-recognize-the/m-p/788035#M81381</link>
      <description>Cynthia - yes. I did miss the definition of the engine. Thank you for all of this information and your assistance. It is greatly appreciated.</description>
      <pubDate>Sun, 02 Jan 2022 18:35:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Libname-is-created-but-the-proc-Contents-doesnt-recognize-the/m-p/788035#M81381</guid>
      <dc:creator>java1982</dc:creator>
      <dc:date>2022-01-02T18:35:51Z</dc:date>
    </item>
    <item>
      <title>Re: Libname is created but the proc Contents doesnt recognize the worksheet name</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Libname-is-created-but-the-proc-Contents-doesnt-recognize-the/m-p/788036#M81382</link>
      <description>Thank you so much... i did look past the engine portion of the syntax. An easy issue for your to recognize and a good lesson for me as a newbie. Thank you so much for your help and mentorship!</description>
      <pubDate>Sun, 02 Jan 2022 18:37:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Libname-is-created-but-the-proc-Contents-doesnt-recognize-the/m-p/788036#M81382</guid>
      <dc:creator>java1982</dc:creator>
      <dc:date>2022-01-02T18:37:02Z</dc:date>
    </item>
    <item>
      <title>Re: Libname is created but the proc Contents doesnt recognize the worksheet name</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Libname-is-created-but-the-proc-Contents-doesnt-recognize-the/m-p/788037#M81383</link>
      <description>Thank you for your post, the Library was getting generated in SAS Studio. I did forget to key the semi-colon when transferring the code. &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;BR /&gt;&lt;BR /&gt;Thank you for your assistance and help here. Its really nice of you and I do appreciate all of this information.</description>
      <pubDate>Sun, 02 Jan 2022 18:38:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Libname-is-created-but-the-proc-Contents-doesnt-recognize-the/m-p/788037#M81383</guid>
      <dc:creator>java1982</dc:creator>
      <dc:date>2022-01-02T18:38:55Z</dc:date>
    </item>
  </channel>
</rss>

