Library does not exist

Reply
N/A
Posts: 1

Library does not exist

Attempting to create a SAS library in Windows 64 SAS Studio University Edition. I get the following:

1 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;

42 ;

43 libname libsas 'c:/users/larry/sasuniversityedition/myfolders';

NOTE: Library LIBSAS does not exist.

44 

45 data libsas.europeancars;

46 set sashelp.cars;

47 where origin = "Europe";

48 run;

ERROR: Library LIBSAS does not exist.

NOTE: The SAS System stopped processing this step because of errors.

NOTE: DATA statement used (Total process time):

  real time 0.00 seconds

  cpu time 0.01 seconds

  

49 

50 proc print data=libsas.europeancars;

ERROR: File LIBSAS.EUROPEANCARS.DATA does not exist.

51 run;

NOTE: The SAS System stopped processing this step because of errors.

NOTE: PROCEDURE PRINT used (Total process time):

  real time 0.00 seconds

  cpu time 0.00 seconds

  

52 ;

53 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;

63 ;

Super User
Posts: 10,500

Re: Library does not exist

SAS Super FREQ
Posts: 8,743

Re: Library does not exist

Hi, In addition to BallardW's suggestions to read previous forum postings, please remember that the SAS University Edition is SAS, running in a Virtual Machine. A Linux Virtual Machine. So it is incorrect for you to use C: drive paths and Windows slashes (\) in your University Edition program.

  The reason you are instructed to set up a shared folder in the University Edition is because you have a box (the SAS VM on Linux) in a box (Your VMware Player or VirtualBox) in a box (your computer). And VMware Player or VirtualBox are the "middleman" between your C: drive and SAS. so if you want to read or write anything from you C: drive, it is far easier to read from and write to your shared folders. That's because SAS talks to the middleman and the middleman talks to your C: drive. So when your program gives SAS instructions about a path name, the instructions have to use Unix slashes (/) and Unix names like "/folders/myfolders/mysubdir".

cynthia

N/A
Posts: 1

Re: Library does not exist

Cynthia, I've been looking around the forums and your post was super helpful. Thanks again for being so clear!

Regular Learner
Posts: 1

Re: Library does not exist

Thank You good description

New Contributor yk_
New Contributor
Posts: 3

Re: Library does not exist

I went through several threads and I understand the concept of a virtual box. I have already set the path for shared folders and named it "myfolders". I created further sub-directories under this "myfolders" directory on my windows machine and I have existing SAS datasets. 

I used the standard statement to create a library, referencing these subfolders but I still get the "Libary does not exist" message as a NOTE. 

 

For eg:

libname test 'folders/myfolders/Projects/IrisExpts';

 

However, if I go ahead and run the following:

 

proc print data=test.iris;
run;

 

The SAS studio is able to show "test" as a library but does not recognize the datasets under this folder. I do have a dataset named "iris" with extension ".sas7bdat".

 

Log: Program 1

proc print data=test.iris;
ERROR: File TEST.IRIS.DATA does not exist.
63 run;
 
I am sure I am missing something very simple but can't figure out. Kindly give me pointers.
THanks.
Super User
Super User
Posts: 6,500

Re: Library does not exist


yk_ wrote:

I used the standard statement to create a library, referencing these subfolders but I still get the "Libary does not exist" message as a NOTE. 

 

For eg:

libname test 'folders/myfolders/Projects/IrisExpts';

 

 

If you do not start the path with / then unix will consider it a relative path instead of an absolute path. So you are looking for a folder named "folder" under the current working directory. When SAS studio start the current working directory is NOT pointing to the root node "/" of you unix directory tree.

libname test '/folders/myfolders/Projects/IrisExpts';
New Contributor yk_
New Contributor
Posts: 3

Re: Library does not exist

Thanks a lot, Tom! 

That worked. 

 

While we are addressing absolute and relative paths in Unix, I am a bit curious about what directory SAS studio considers as current. In the VirtualBox, I have set a path (pointing to a directory in C drive) as the shared folder. So, would SAS studio treat this shared folder (for eg: C:\YK\SAS\myfolders) as CWD? Because I am a little confused about using "folders" in the path ('/folders/myfolder/dir1/dir2') of the libname command, when I don't actually have a directory named "folders". I am sorry, this is a little off, but it might help me with silly issues later on.

 

Thanks again! 

 

Super User
Super User
Posts: 6,500

Re: Library does not exist


yk_ wrote:

 

While we are addressing absolute and relative paths in Unix, I am a bit curious about what directory SAS studio considers as current. In the VirtualBox, I have set a path (pointing to a directory in C drive) as the shared folder. So, would SAS studio treat this shared folder (for eg: C:\YK\SAS\myfolders) as CWD? Because I am a little confused about using "folders" in the path ('/folders/myfolder/dir1/dir2') of the libname command, when I don't actually have a directory named "folders". I am sorry, this is a little off, but it might help me with silly issues later on.

 

 


SAS/Studio is launching a SAS session differently then you would when starting it from the command line. So the current working directory is just some directory under the area on the virtural Unix machine where the SAS software is installed. You should not have write access to that folder I would think.  Plus if you are running SAS University Edition then the ability for you to use the X , SYSTEM or %SYSEXEC commands to run a CD command to change the current working directory will be disabled.  So always make sure to tell SAS fully qualified names to use for files or libraries.

 

If you can see the files in the "Server Files and Folders" panel on the left then you can right click on a folder or a file and ask for properties and see the fully qualified path to that location.  That path will work in the SAS code.

 

 

 

New Contributor yk_
New Contributor
Posts: 3

Re: Library does not exist

Okay, that makes sense. I do not seem to have access to check the CWD or run any other commands on the virtual machine. Perhaps, it is a protocol to refer to CWD as "folders" and use the subsequent path. 

   

If you can see the files in the "Server Files and Folders" panel on the left then you can right click on a folder or a file and ask for properties and see the fully qualified path to that location.  That path will work in the SAS code.

 









THIS was very useful. I wish the guides put in simple instruction such as the above and save many of us a lot of headache.  Thank you Tom.


























Super User
Super User
Posts: 6,500

Re: Library does not exist

Not that it will help you, but you can let SAS figure out the current directory if you are curious about it.

libname here '.';
%put %sysfunc(pathname(here));
libname here clear ;

So for example the user in this thread https://communities.sas.com/t5/Base-SAS-Programming/Importing-SAS-file-via-Citrix-Reciever/m-p/37739... would see this path in the log.

57         %put %sysfunc(pathname(here));
/opt/sasconfig/grd/Lev1/SASApp
Occasional Contributor
Posts: 17

Re: Library does not exist

library could only be a folder. try to use your folder.

Ask a Question
Discussion stats
  • 11 replies
  • 7181 views
  • 6 likes
  • 8 in conversation