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

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

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Panagiotis
SAS Employee

Great! If you can, can you mark this as solved?

View solution in original post

24 REPLIES 24
PremS
Obsidian | Level 7

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.

 

 

image.png

 

 

arbresel
Fluorite | Level 6

Many thanks, the pg1 is recreated 🙂

SAM9
Calcite | Level 5

HI I tried your suggestion but am still getting this error message  

WARNING: "Libref EPG1 is not assigned"

Panagiotis
SAS Employee

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

psmith18
Calcite | Level 5

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?

 

Cynthia_sas
SAS Super FREQ
Hi: I would recommend that you save the successful LIBNAME statements into a file called LIBNAME.SAS or MYLIBS.SAS or whatever will be easily remembered. Every time you start a new SAS session and you want to go back to work with the Programming 1 data, you'll need to submit that code to re-establish the connection between SAS and your data.
Cynthia
Panagiotis
SAS Employee

Hi @arbresel, did the response answer your question?

arbresel
Fluorite | Level 6

Yes 🙂

Panagiotis
SAS Employee

Great! If you can, can you mark this as solved?

abdis
Fluorite | Level 6

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";

Panagiotis
SAS Employee

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';

 

 

abdis
Fluorite | Level 6

That did the trick - thank you! I will mark as resolved.

Panagiotis
SAS Employee

Glad it worked!

abdis
Fluorite | Level 6

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!

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!

LIBNAME 101

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.

Discussion stats
  • 24 replies
  • 13770 views
  • 11 likes
  • 12 in conversation