BookmarkSubscribeRSS Feed
zhangrachel0118
Calcite | Level 5
  1. Open a new program window in SAS Studio. Write a LIBNAME statement to create a library named PG1 that reads SAS tables in the EPG1V2/data folder. If you are not sure of the path to your data folder, right-click the data folder in the navigation pane and select Properties. You can copy the path shown there.

  2. Run the code. After the code runs, you should see a note in the log that the library was successfully assigned.

  3. Select the Code tab. Save your program as libname.sas in the course folder. You can replace the file if it already exists.

  4. Select Libraries in the navigation pane and expand My Libraries.

  5. Expand the PG1 library and view the list of SAS tables.

After I created the code for PG1 library and run it on SAS Studio, it said  Library PG1 does not exist. And I am not sure if this is the correct respond that everyone get, and because of this mistake I cannot be successful at the following activities as well. And my code is libname pg1 base "FILEPATH/EPG1V2/data". Thank you.

2 REPLIES 2
Tom
Super User Tom
Super User

I really doubt that there exists a subdirectory named FILEPATH in whatever directory is the current working directory for the SAS session you are running.  That is where your LIBNAME statements is tell SAS to look for the subdirectory named EPG1V2.

 

What did you see as the path when you checked the properties of the data subdirectory using SAS/Studio's Files and Folders tab?

Cynthia_sas
SAS Super FREQ

Hi, @Tom is correct. The word FILEPATH is a placeholder for YOUR filepath where the EPG1V2 folder is located. We expect the student to replace the word FILEPATH with their location of the EPG1V2 data folder.
For example, here are some sample LIBNAME statements:

Cynthia_sas_0-1700273428817.png

 


Here are some things to check:
1) When you look in the Server Files and Folders panel, do you have a Files (Home) top level folder? This typically means you are using SAS OnDemand for Academics. If you see a C: drive and an S: drive, this typically means you are using the Virtual Lab on our Citrix-based Virtual Lab provided with Programming 1.
2) Can you locate an EPG1V2 folder?
3) If you expand the EPG1V2 folder do you have 5 subfolders? The subfolders are: activities, data, demos, output, practices (If you do have the subfolders, that is a good sign. If you do NOT have the subfolders, that is an indication that you have NOT yet run the data creation program for Programming 1).
4) If you do have a data subfolder, expand the data subfolder and check to see the type of files that are in the folder. If you only see CSV and XLSX files and a few other types of files, then check to see whether you have files with an extension of .sas7bdat. If you do NOT see any .sas7bat files, this is an indication that you either did not run the data creation program or there was a problem running the data creation program.
  Without knowing how you are using SAS and whether you ran the data creation program successfully, it is hard to provide more constructive advice.
  However, assuming you DO see Files (Home) or S:\workshop and you DO have an EPG1V2 folder with a data subfolder, you should be able to right click on the data subfolder and choose Properties. The Location field of the Properties window should show you the EXACT filepath that you need to use.
  If none of these suggestions help you and you are unable to figure out the correct LIBNAME statement for your method of practicing the class, then please send mail directly to elearn@sas.com and the instructors on duty will help you with the LIBNAME statement.
Cynthia

Welcome to the Certification Community

 

This is a knowledge-sharing community for SAS Certified Professionals and anyone who wants to learn more about becoming SAS Certified. Ask questions and get answers fast. Share with others who are interested in certification and who are studying for certifications.To get the most from your community experience, use these getting-started resources:

Community Do's and Don'ts
How to add SAS syntax to your post
How to get fast, helpful answers

 

Why Get SAS Certified.jpg

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 2 replies
  • 943 views
  • 0 likes
  • 3 in conversation