BookmarkSubscribeRSS Feed
gowster
Calcite | Level 5

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 ;

11 REPLIES 11
Cynthia_sas
SAS Super FREQ

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

kjchoi10
Calcite | Level 5

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

abhishek4
Calcite | Level 5

Thank You good description

yk_
Fluorite | Level 6 yk_
Fluorite | Level 6

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.
Tom
Super User Tom
Super User

@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';
yk_
Fluorite | Level 6 yk_
Fluorite | Level 6

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! 

 

Tom
Super User Tom
Super User

@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.

 

 

 

yk_
Fluorite | Level 6 yk_
Fluorite | Level 6

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.


























Tom
Super User Tom
Super User

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
JaneLi
Calcite | Level 5

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

SAS Innovate 2025: Register Now

Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 11 replies
  • 32398 views
  • 14 likes
  • 8 in conversation