BookmarkSubscribeRSS Feed
Esmatullah
Calcite | Level 5

Hi there,

 

I am an absolute newbie in programming and in SAS. I am taking an essential e-learning course right now to familiarize myself with the basics. 

 

I created the PG1 library yesterday as it was required by the course. Today, I wanted to write a journal about my learning, but I was stuck in creating a library section. I wanted to provide an example of what I have learned but it did not work. I used both localhost and the SAS Studio server. In both cases, I received errors in my log and I wanted to change the path of PG1 and that showed invalid. 

 

Please help me what is the problem. I want to use this activity as an example of my self-study journal. 

 

Thanks,

 

Esmat

3 REPLIES 3
ballardw
Super User

When you have a question about errors the best thing with this forum is to copy the code and error messages from the log and paste into a code box opened on the forum using the {I} icon.

You should also describe your SAS environment.

 

Unless you use one of the options, depends on SAS environment, to create permanent libraries the reference for a library will only exist for that session.

And with servers, again depending on environment, you may not be able to use simple code to reference a disk location on your computer as the Server likely 1) does not have permissions to generally use your computer and 2) paths in code would tend to be in reference to the Server and C:\ would be the Server drive, not yours.

 

Esmatullah
Calcite | Level 5

Thanks for the recommendation. I made a mistake attaching those errors as a file which do not appear in my question. 

 

the code:

 

libname pg1 "FILEPATH";

 
the log: 
 
1 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;
72
73 libname pg1 "FILEPATH";
NOTE: Library PG1 does not exist.
74
75
76 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;
 
The Path to replace with the FILEPATH: 
 
/folders/myfolders/EPG194/data";
 

 

ballardw
Super User

@Esmatullah wrote:

Thanks for the recommendation. I made a mistake attaching those errors as a file which do not appear in my question. 

 

the code:

 

libname pg1 "FILEPATH";

 
the log: 
 
1 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;
72
73 libname pg1 "FILEPATH";
NOTE: Library PG1 does not exist.
74
75
76 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;
 
The Path to replace with the FILEPATH: 
 
/folders/myfolders/EPG194/data";
 

 


The syntax for your library was incorrect as the actual value of the file path needs to appear between the quotes.

 

libname pg1 "/folders/myfolders/EPG194/data";

sas-innovate-2026-white.png



April 27 – 30 | Gaylord Texan | Grapevine, Texas

Registration is open

Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!

Register now

Develop Code with SAS Studio

Get started using SAS Studio to write, run and debug your SAS programs.

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
  • 3 replies
  • 1247 views
  • 2 likes
  • 2 in conversation