Hello,
I am a SAS beginner and self learninig with SAS Programming 1: Essentials training with SAS Studio on line.
I am blocked when I restart SAS Studio, for exemple in lesson 3 : Exploring and Validating Data
My question is that I don't understand how to excute libname.sas to recreate the PG1 library once I restart SAS studio ?
Here is the remander:
Reminder: If you restarted your SAS session,you must recreate the PG1 library so you can access your practice files. In SAS Studio, open and submit the libname.sas program in the EPG194 folder.
Righe click the folder EPG04, then I open a new program (or F4) and execute libname.sas in code, and run, but it doesn't work...
Thanks for your help
Great! If you can, can you mark this as solved?
LIBNAME.SAS was a program with code you wrote in Lesson 2: Accessing Data Through Libraries. The program should have a LIBNAME statement as written below:
libname pg1 "FILEPATH";
Just replace the text FILEPATH with the location of the EPG194/data folder. It might be called something different on your SAS Studio. If you right click the data folder and click Properties (picture below), then you can see the Location and copy it into your LIBNAME statement.
I am guessing you did that activity but did not save the program as LIBNAME.SAS, so nothing's wrong at all! Let me know if this works.
Many thanks, the pg1 is recreated 🙂
HI I tried your suggestion but am still getting this error message
WARNING: "Libref EPG1 is not assigned"
Out of curiosity, are you using SAS University Edition or SAS On Demand for Academics? Or a local version of SAS?
You need to find the location of the data folder, confirm that there are tables in that location, then copy the file location. You will use that in a LIBNAME statement to tell SAS where to look for all the data.
For example. My data is in my S:\workshop\data folder. In that location I have 25 SAS tables. I need to tell SAS where the tables are.
LIBNAME pg1 "S:\workshop\data";
If there are not tables in that location you will need to create the data for the course. You can do that by checking out these videos: https://communities.sas.com/t5/Programming-1-and-2/bd-p/course_discussions
Let me know if that works.
- Peter
Hi...I had the same problem and I think I fixed it (think being the key word), and I'm wondering how do I save whatever I did so it don't have to keep coming back to the community page to find answers?
Hi @arbresel, did the response answer your question?
Yes 🙂
Great! If you can, can you mark this as solved?
I have a related question. I am using SAS studio. I logged out and when I began a new session, I recreated the library using my saved libname program. When I run the program, it does create the PG 1 library. However the PG1 library folder is empty - no tables. I am directing the libname statement to my EPG 194 folder within SAS studio where I do see many tables. Why is the library empty? Here is my syntax:
LIBNAME pg1 "/home/u44988922/EPG194";
Looks like you are using SAS On Demand for Academics?
Physically go to the folder you pointed to with your LIBNAME statement. You should see that there are folders in that location but no actual SAS data sets. You need to go into the data subfolder.
Go into that data folder through the Server Files and Folders pane. You should see data in it. If you do, you set it up correctly and need to tell SAS 'Go to that data folder, I have data there I want to use'. You can right click on the data folder, select properties and see the location.
To tell SAS you want to use the data in that location make sure to use the LIBNAME statement to point to it. You need to most likely add data to the end of your path:
libname pg1 '/home/u44988922/EPG194/data';
That did the trick - thank you! I will mark as resolved.
Glad it worked!
Well, I don't see an option to mark this solution - perhaps because the thread already is marked as solved. At any rate, thank you for your help!
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!
Follow along as SAS technical trainer Dominique Weatherspoon expertly answers all your questions about SAS Libraries.
Find more tutorials on the SAS Users YouTube channel.