BookmarkSubscribeRSS Feed
borivlikar
Calcite | Level 5

Hello team of knowledge base,

 

I am having an issue where I am self learning sas programming essentials 1 module two-access data. When I give the correct file path to Create the library , I keep getting an error..libname does not exist.

 

the syntax I am using is libname pg1 "file path" and the folder I am accessing is epg194/data.

 

Can someone tell me what I am doing incorrectly.

 

thanks,

RS

10 REPLIES 10
borivlikar
Calcite | Level 5
Please see the exact syntax below:

1 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;
72
73 libname pg1 "SAVESSD/Users/Rahulsave/downloads/epg194/data";
NOTE: Library PG1 does not exist.
74 run;
75
76
77 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;
89
borivlikar
Calcite | Level 5
Library created but not sure if it has data in it. can't save to EPG194 folder.
Tom
Super User Tom
Super User

You don't want to use a RELATIVE path.  Especially when running SAS via SAS/Studio where you have no control over what the current directory that the SAS process is using.

 

On Unix ABSOLUTE paths must start with the root node. So the path must start with / .

borivlikar
Calcite | Level 5
I apologize tom. Not sure what relative path means. my understanding is very basic so if you don't mind explaining it more...I will try it.
borivlikar
Calcite | Level 5

borivlikar_0-1584883206938.png

PG1 libref created but has not data in it. Furthermore when I try to save the program docent allow me to save anywhere in epg194. currently stored in some folders/myfolders/libname.sas ( not sure where this is from---- saw this message at base of the sas study window)

Tom
Super User Tom
Super User
/folders/myfolders/ is the path that is used by SAS University Edition to point to the actual folder on your physical machine. Again notice how I typed the root node slash, which is different than how you typed it. So you might have mapped that to some folder like C:\users\myname\SAS on your machine if you are running windows or some other path. If you are using a mac then the path will look like a unix path since MacOS is just a flavor of unix. So it will start with a slash instead of a drive letter.
So in your SAS code you need to always use /folders/myfolders/ as the starting point for your paths. From there you should be able to see any files you put into the folder on your real machine that are in or under the folder you shared.

Reeza
Super User

Go the PG1 folder in the picture, right click it and select properties. Copy the path in the properties and use EXACTLY that as your path. Unless you're using a private installation of SAS I don't think your path is correct for either SAS UE or SAS On Demand for Academics. 

 


@borivlikar wrote:

borivlikar_0-1584883206938.png

PG1 libref created but has not data in it. Furthermore when I try to save the program docent allow me to save anywhere in epg194. currently stored in some folders/myfolders/libname.sas ( not sure where this is from---- saw this message at base of the sas study window)


 

Cynthia_sas
SAS Super FREQ

Hi:
Please do NOT go to Libraries. Please go to Server Files and Folders. Find the EPG194/data folder. Right click on the folder IN THE SERVER FILES AND FOLDERS pane and choose Properties. Then look on the LOCATION field on the popup window. That shows you the EXACT full path location you need to use. It appears that you are using SAS University Edition in a Virtual Machine. IF (and only IF) you have defined your shared folders correctly, the path should be something like this:
libname pg1 "/folders/myfolders/EPG194/data";

IF you did NOT define your shared folders correctly, then I suggest you go back to the setup instructions for SAS University Edition and make sure you've correctly defined the shared folder location.

Whether you are using a Mac or a Windows machine, with SAS University Edition, if you have shared folders correctly defined, the "high level" part of your path should ALWAYS be: /folders/myfolders then the subfolders under that location (like EPG194) will be:
/folders/myfolders/EPG194

/folders/myfolders/EPG194/data (for the main data folder)
/folders/myfolders/EPG194/output (for the output folder)

Hope this helps,
Cynthia

Reeza
Super User
Thanks Cynthia, missed the part where it was Libraries not Servers Files and Folders.
Tom
Super User Tom
Super User
You asked SAS to look in the current directory for a sub-directory named SAVESSD and then more sub-directories under that. It is NOT finding such a directory. Instead you should start the path with a / so that it starts at the top level directory and then works its way down to the Users directory. Also remember that on Unix all filenames are case sensitive. https://homepages.uc.edu/~thomam/Intro_Unix_Text/File_System.html
Make sure to follow the instructions exactly. Also make sure you are following the instructions for how you are running SAS. SAS University Edition run in a virtual machine that runs on your computer. The path you showed is more like you would get when running on full Unix system. Perhaps one of the cloud based on demand servers that SAS also provides?

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
Mastering the WHERE Clause in PROC SQL

SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 10 replies
  • 1266 views
  • 0 likes
  • 4 in conversation