<?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 error in SAS Studio</title>
    <link>https://communities.sas.com/t5/SAS-Studio/LIBNAME-error/m-p/759076#M10124</link>
    <description>&lt;P&gt;It makes no sense to point a LIBNAME at a SAS program file.&lt;/P&gt;
&lt;P&gt;You could point a FILENAME to it.&lt;/P&gt;
&lt;P&gt;But you probably want to instead just open it in the editor and run the code it contains.&lt;/P&gt;</description>
    <pubDate>Tue, 03 Aug 2021 16:44:22 GMT</pubDate>
    <dc:creator>Tom</dc:creator>
    <dc:date>2021-08-03T16:44:22Z</dc:date>
    <item>
      <title>LIBNAME error</title>
      <link>https://communities.sas.com/t5/SAS-Studio/LIBNAME-error/m-p/759065#M10122</link>
      <description>&lt;P&gt;In my SAS on Demand code, the LIBNAME&amp;nbsp; was copied from its entry on the left panel, but it produced an error shown in the attachment below. Could someone please tell me how to fix it?&lt;/P&gt;</description>
      <pubDate>Tue, 03 Aug 2021 16:01:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/LIBNAME-error/m-p/759065#M10122</guid>
      <dc:creator>wmjklein</dc:creator>
      <dc:date>2021-08-03T16:01:56Z</dc:date>
    </item>
    <item>
      <title>Re: LIBNAME error</title>
      <link>https://communities.sas.com/t5/SAS-Studio/LIBNAME-error/m-p/759068#M10123</link>
      <description>&lt;P&gt;Libnames typically point to storage locations, i.e. folders. The exceptions are things like XLSX files where each "tab" would be treated as a data set in a library.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Your file the libname points with the SAS extension is likely a TEXT file and not valid for a library. Remove the file name and just use the folders and see if that helps.&lt;/P&gt;</description>
      <pubDate>Tue, 03 Aug 2021 16:05:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/LIBNAME-error/m-p/759068#M10123</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2021-08-03T16:05:18Z</dc:date>
    </item>
    <item>
      <title>Re: LIBNAME error</title>
      <link>https://communities.sas.com/t5/SAS-Studio/LIBNAME-error/m-p/759076#M10124</link>
      <description>&lt;P&gt;It makes no sense to point a LIBNAME at a SAS program file.&lt;/P&gt;
&lt;P&gt;You could point a FILENAME to it.&lt;/P&gt;
&lt;P&gt;But you probably want to instead just open it in the editor and run the code it contains.&lt;/P&gt;</description>
      <pubDate>Tue, 03 Aug 2021 16:44:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/LIBNAME-error/m-p/759076#M10124</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2021-08-03T16:44:22Z</dc:date>
    </item>
    <item>
      <title>Re: LIBNAME error</title>
      <link>https://communities.sas.com/t5/SAS-Studio/LIBNAME-error/m-p/761506#M10133</link>
      <description>&lt;P&gt;I have attached a snip showing the left panel in my SAS on Demand session (SASOnDemandLibname04.pdf).&amp;nbsp; I altered my SAS code for the LIBNAME and INFILE statements to point to the Windows 10 folder and its file containing my data (SASOnDemandLibname05.pdf). Still no success. Someone please tell me what's wrong.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 13 Aug 2021 21:59:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/LIBNAME-error/m-p/761506#M10133</guid>
      <dc:creator>wmjklein</dc:creator>
      <dc:date>2021-08-13T21:59:56Z</dc:date>
    </item>
    <item>
      <title>Re: LIBNAME error</title>
      <link>https://communities.sas.com/t5/SAS-Studio/LIBNAME-error/m-p/761514#M10134</link>
      <description>&lt;P&gt;So the error messages are very clear.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="image.png" style="width: 656px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/62564i76C51E6676502036/image-size/large?v=v2&amp;amp;px=999" role="button" title="image.png" alt="image.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="image.png" style="width: 646px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/62565i957D86BF2748DACD/image-size/large?v=v2&amp;amp;px=999" role="button" title="image.png" alt="image.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;There is not a file named 'weight01.dat' in the current working directory of '/pbr/biconfig/940/Lev1/SASapp/'.&amp;nbsp; There is also no subdirectory of that location named 'C:\DATA\SAS\Weight'.&amp;nbsp; &amp;nbsp;To use an absolute path on a UNIX operating system the path must start with the root node.&amp;nbsp; That is the leading / you can see in the error message.&lt;/P&gt;
&lt;P&gt;If you want to see what is the path to reference the Weight directory just right click on&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="image.png" style="width: 387px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/62566i4EC4D64A9C94C092/image-size/large?v=v2&amp;amp;px=999" role="button" title="image.png" alt="image.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;and select properties. One of the properties will be the path.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Or you could just try using ~ (tilda character) to indicate that you want the path to start from your userid's home directory.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;libname wght '~/Weight';
...
infile '~/Weight/weight01.dat' ...&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 13 Aug 2021 22:13:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/LIBNAME-error/m-p/761514#M10134</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2021-08-13T22:13:35Z</dc:date>
    </item>
    <item>
      <title>Re: LIBNAME error</title>
      <link>https://communities.sas.com/t5/SAS-Studio/LIBNAME-error/m-p/761554#M10135</link>
      <description>&lt;P&gt;The SAS session on which you run your code does not have access to your desktop's storage, as it runs in the cloud.&lt;/P&gt;
&lt;P&gt;The only access that On Demand provides is the upload/download facility of SAS Studio.&lt;/P&gt;
&lt;P&gt;This is the reason why your LIBNAME does not work. You can define a library reference only for directories on the server where you have the necessary permissions, which usually means subdirectories of your home directory.&lt;/P&gt;</description>
      <pubDate>Sat, 14 Aug 2021 05:40:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/LIBNAME-error/m-p/761554#M10135</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2021-08-14T05:40:34Z</dc:date>
    </item>
    <item>
      <title>Re: LIBNAME error</title>
      <link>https://communities.sas.com/t5/SAS-Studio/LIBNAME-error/m-p/764334#M10146</link>
      <description>&lt;P&gt;I have attached a snip from my log showing the LIBNAME and INFILE statements with the tilda, but the error persists. What have I done wrong?&lt;/P&gt;&lt;P&gt;In right-clicking the file directory in the left panel, I found the following locations:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;/home/u57995729&lt;/P&gt;&lt;P&gt;/home/u57995729/sasuser.v94&lt;/P&gt;&lt;P&gt;/home/u57995729/Weight/weight01.dat&lt;/P&gt;&lt;P&gt;I have searched for documentation on the LIBNAME statement on the Internet for SAS but the only response was an offer for training.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I also searched for 'tilda' in the shortcuts documentation but it could not be found.&lt;/P&gt;&lt;P&gt;Your help is much appreciated.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV class="mceNonEditable lia-copypaste-placeholder"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 26 Aug 2021 20:26:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/LIBNAME-error/m-p/764334#M10146</guid>
      <dc:creator>wmjklein</dc:creator>
      <dc:date>2021-08-26T20:26:39Z</dc:date>
    </item>
    <item>
      <title>Re: LIBNAME error</title>
      <link>https://communities.sas.com/t5/SAS-Studio/LIBNAME-error/m-p/764338#M10147</link>
      <description>&lt;P&gt;Use the LIBNAME keyword only once in the LIBNAME statement.&lt;/P&gt;</description>
      <pubDate>Thu, 26 Aug 2021 20:37:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/LIBNAME-error/m-p/764338#M10147</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2021-08-26T20:37:44Z</dc:date>
    </item>
    <item>
      <title>Re: LIBNAME error</title>
      <link>https://communities.sas.com/t5/SAS-Studio/LIBNAME-error/m-p/764340#M10148</link>
      <description>&lt;P&gt;There is a syntax error in your screenshot that you embedded into a PDF and then attached as a file.&amp;nbsp; (Why go to all that work? If you have to attach a photograph just click on the icon that looks like a camera. But better still click on the &amp;lt;/&amp;gt; icon and insert the actual text from the SAS log)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You have the the keyword LIBNAME twice.&amp;nbsp; The second one is the place where you could tell SAS to use a special engine for defining the libname (like XLSX or ODBC or ORACLE or XPORT).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So given the paths you are showing these statements should work.&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;libname home '/home/u57995729';
libname sasuser2 '/home/u57995729/sasuser.v94';
libname weight '/home/u57995729/Weight';
filename in '/home/u57995729/Weight/weight01.dat';
data weight.weight01;
  infile in ;
  input ....&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;So the first three are LIBNAME statements to create three librefs that point to the three folder (directory) names that you included.&amp;nbsp; The next is a FILENAME statement to create a fileref that points to the one filename that you included.&lt;/P&gt;
&lt;P&gt;I changed the LIBNAME statement to use WEIGHT as the libref.&amp;nbsp; You can use up to 8 characters in a libref (or a fileref).&lt;/P&gt;
&lt;P&gt;I change the DATA statement to create a permanent dataset by writing it into the directory where the .dat file lives.&lt;/P&gt;
&lt;P&gt;You will need to complete the rest of the DATA step as I am not sure what you .dat file contains.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here is a way for you to have SAS show some of the content of the .dat file into the SAS log so you can review it and decide how to write the data step to read it.&amp;nbsp; It will read just the first 5 lines and write them to the SAS log with a ruler so you can see in which column the characters appear.&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;filename in '/home/u57995729/Weight/weight01.dat';
data _null_;
  infile in  obs=5;
  input;
  list;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 26 Aug 2021 20:49:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/LIBNAME-error/m-p/764340#M10148</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2021-08-26T20:49:00Z</dc:date>
    </item>
  </channel>
</rss>

