BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
NSK
Fluorite | Level 6 NSK
Fluorite | Level 6

Hi,

 

I am new to SAS and working through the SAS Programming 1: Essentials training. I am using SAS Enterprise Guide and I am connected to a SAS server. I am trying to set up my practice files. I am using the instructions provided for SAS Windowing Environment. I copied the folder into the SAS drive and replaced the FILEPATH with the actual path for the folder. When I run the program, I get this error "LIbrary PG1 does not exist.". I have seen answers for similar posts but I am unable to figure out why this is not working. Please see the code below. I would really appreciate if someone can help with this.

 

%let path = F:\NSK\SAS_Training\EPG194;

libname PG1 "&path";

 

Thanks,

NSK 

 
1 ACCEPTED SOLUTION

Accepted Solutions
jebjur
SAS Employee

Try using the UNC path instead of a mapped drive letter when you submit the LIBNAME statement from Enterprise Guide.

View solution in original post

15 REPLIES 15
ballardw
Super User

If you are running EG connected to a server then the SERVER has to see the path. If the server does not have an F drive mapped then it "doesn't exist".

You need to ensure that the path is acceptable to the server. If the location is on a network shared drive or such you may need to use a different reference from the server's perspective. If the F drive is a local drive to your computer you will need to work with your SAS admin and/or IT folks to set up a share or something. Or use a different location both you and the server can access.

NSK
Fluorite | Level 6 NSK
Fluorite | Level 6

Thank you for your quick response. The F drive is mapped to the SAS server. I am also able to see the folder in question under Servers -> SASApp -> Files on the left hand of the SAS Enterprise Guide.

 

Can you think of anything else that could be an issue?

Tom
Super User Tom
Super User

Is the path the same?  Your SASapp server is running Windows also?

ballardw
Super User

When you run this code:

%let path = F:\NSK\SAS_Training\EPG194;

libname PG1 "&path";

Do you get a result in the log that looks like:

 

NOTE: Libref PG1 was successfully assigned as follows:

If not, then the library wasn't assigned and doesn't exist and you should perhaps post the log from running the LIBNAME statement.

 

NSK
Fluorite | Level 6 NSK
Fluorite | Level 6

Please see the log below:

 


1 %_eg_hidenotesandsource;
5 %_eg_hidenotesandsource;
28
29 %let path = F:\NSK\SAS_Training\EPG194;
30
31 libname PG1 "&path";
NOTE: Library PG1 does not exist.
32
33 %_eg_hidenotesandsource;
45
46
47 %_eg_hidenotesandsource;
50

jebjur
SAS Employee

Try using the UNC path instead of a mapped drive letter when you submit the LIBNAME statement from Enterprise Guide.

NSK
Fluorite | Level 6 NSK
Fluorite | Level 6

Thank you very much. I didnt know what UNC path is. I looked it up and replaced the F drive with the UNC path. And I cant believe but it worked.

 

1 %_eg_hidenotesandsource;
5 %_eg_hidenotesandsource;
28
29 %let path = \\server1088\Files\NSK\SAS_Training\EPG194;
30
31 libname PG1 "&path";
NOTE: Libref PG1 was successfully assigned as follows:
Engine: V9
Physical Name: \\server1088\Files\NSK\SAS_Training\EPG194
32
33 %_eg_hidenotesandsource;
45
46
47 %_eg_hidenotesandsource;
50

 

 

 

fernandavello
Calcite | Level 5

I was going crazy here.  I finally got it after copying my folder's path and pasting it into the code.  You guys opened my eyes. 

cloudyeye
Calcite | Level 5

I am having this issue too, even after reading this forum.

Initially I ran this as a tutorial I was following told me to:

1 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;
70
71 /***********************************************/
72 /* In the line of code below, replace FILEPATH */
73 /* with the path to your EPG194/data folder */
74 /***********************************************/
75
76 %let path=~/EPG194/data;
77
78 /**********************************************/
79 /* DO NOT EDIT THE CODE BELOW */
80 /**********************************************/
81
82 libname PG1 "&path";
NOTE: Library PG1 does not exist.
83
84
85
86 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;
 
Then I tried to use the folder location to resolve the error but that didn't work (because it is not the UNC path? I don't know what the UNC path is...)
 
1 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;
70
71 /***********************************************/
72 /* In the line of code below, replace FILEPATH */
73 /* with the path to your EPG194/data folder */
74 /***********************************************/
75
76 %let path=C:\Users\claud\Documents\SAS;
77
78 /**********************************************/
79 /* DO NOT EDIT THE CODE BELOW */
80 /**********************************************/
81
82 libname PG1 "&path";
NOTE: Library PG1 does not exist.
83
84
85
86 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;
 
Any help on what a UNC path is, how to get it and how it should be inserted into the code?
Thanks.
jebjur
SAS Employee

First of all, are you connecting to a local SAS server from Enterprise Guide (Base SAS is installed on the same PC as Enterprise Guide and the connection profile is 'No Profile Selected'), or are you connecting to a remote SAS server? If a remote server, is the operating system Windows or Unix? When connecting to a remote SAS server from Enterprise Guide, the server needs to be able to access the path you are specifying on the LIBNAME statement. For example, a remote server will most likely not be set up to access the files on your local PC, but it may be able to access a shared network drive. 

 

 A UNC (universal naming convention) path uses double slashes or backslashes to precede the name of the computer. The path (disk and directories) within the computer are separated with a single slash or backslash, as in the following examples. Note that in the DOS/Windows example, drive letters (c:, d:, etc.) are not used in UNC names.


   //servername/path   Unix

   \\servername\path   DOS/Windows

 

For example, you may have a mapped drive on your PC that is using the drive letter 'F'. 'F' is actually mapped to a network server named server123 and a directory named SAS_Files. Your training files are located in the subdirectory EGP194 within SAS_Files. So instead of using the path of 'F:\EGP194', the UNC path would be '\\server123\SAS_Files\EGP194'.  Does that help?

cloudyeye
Calcite | Level 5
Okay. I understand it in theory but I don't know practically how I find out what the server name or number is for the drive holding the files. If I'm using Windows 10, what do you actually need to do to get the server info for a drive? Unsure if I would be able to correctly write out the rest of the file location after the server either.
I've just been randomly plugging in file locations for a while now, trying to sort this -_- ha

Thanks.
sidd315
Calcite | Level 5

Hi All

 

I am encountering the same issue where I am assigning a library with a UNC path and the assigning of the libraries doesn't show any error but the log in the enterprise edition says that the library does not exist.

 

Could you please help?

 

Kind Regards

Siddharth

toks020
Calcite | Level 5

I have tried to copy the path to my folders but it still gives error someone should please help. I don't know if there is something that I an doing wrong. 

 

 

%let path= C:\Users\Nurat\Documents\EPG194;
libname PG1 "&path";
Karen29
Calcite | Level 5

I have the same issue. The files are on my c:\ drive. I am using Windows 10 as the OS.

 

I entered:

%let path=c:\SASUniversityEdition\myfolders\EPG194\;

 

and I get error Library PG1 does not exist.

I can't see what I am doing wrong.

 

I also tried

\\localhost\c$\SASUniversityEdition\myfolders\EPG194\;

 

same error.

 

I would appreciate it assistance with what I would think would be a simple task.

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

SAS Enterprise Guide vs. SAS Studio

What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 15 replies
  • 10384 views
  • 4 likes
  • 9 in conversation