Hi,
I am new to sas studio. I was learning how to create libname and I was doing an
e-learning course. However, I am stuck with these codes which I obtained from the
course. At first, I use properties in Data and paste it in the filepath.
When I run the libname, it says STAT1 does not exist. I tried to create a libname
and still it does not work. I am stuck and I cannot carry on with the course.
Can you help please?
%let homefolder=FILEPATH/myshortcuts/Myfolders/ECST142/data/STAT1;
libname STAT1 "&homefolder";
Vanessa
Hi:
In the STAT1 course, you need to replace FILEPATH with YOUR path to the folder that you unzipped.
If you are using SAS University Edition in a virtual machine, typically you do NOT put the files in a "shortcuts" folder. We tell you to write the folder directly under your My Folders top node. In this case, the path would be something like:
%let homefolder=/folders/myfolders/ECST142/data;
libname STAT1 "&homefolder";
or else it would be something like this:
%let homefolder=/folders/myfolders/ECST142/data;
libname STAT1 "/folders/myfolders/ECST142/data";
(note that STAT1 programs usually expect to find the helper variable &homefolder defined as the path to the data folder)
Note how the top folder path is /folders/myfolders. The fastest way to find the correct full path to use is to go to SAS Studio and find your ECST142/data folder. Right click on the folder name and choose Properties. When you do that, the Location field in the Properties window will show you the EXACT path that you need to use.
Hope this helps,
cynthia
Your need to replace the literal text FILEPATH with the actual path. It needs to be the path on the machine (virtual or real) where SAS is running.
Re-read @Cynthia_sas 's post more carefully. She has explained everything you need to know to fix your problem.
Hi Cynthia,
I have really hard to create the libname to obtain all the datasets for the folder
EPG194. For this folder, there is no way, I could find the datasets. When I was working on the statistics module, I had these codes to create the SAS datasets. I could see the createdata.sas. The codes to create the macros are:
/* create macro variables to hold the names of the interval and */
/* categorical variables used in the demo and practice programs */
%let interval=Gr_Liv_Area Basement_Area Garage_Area Deck_Porch_Area
Lot_Area Age_Sold Bedroom_AbvGr Total_Bathroom;
%let categorical=House_Style2 Overall_Qual2 Overall_Cond2 Fireplaces
Season_Sold Garage_Type_2 Foundation_2 Heating_QC
Masonry_Veneer Lot_Shape_2 Central_Air;
Vanessa
Hi:
Please go to your My Training page (https://support.sas.com/edu/viewmyelearn.html ) and sign on to your SAS Profile, if prompted. Then click on Programming 1 in the list of e-learning classes.
Once you are inside Programming 1, you should see a Table of Contents with the Course Overview and Data Setup lesson at the very top, as shown below:
When you click on the lesson highlighted above, you will next see this:
Watch and listen to the material in this lesson and then click on the last topic in the list and you will see THIS:
When you click on the link for your method of using SAS, you should see this
click on the words "this zip file" in order to start the download of the zip file. Here's what the zip file looks like for SAS University Edition:
There is a main/top folder called EPG194 and several sub-folders under that main folder. ALL of the zip file should be unzipped to your shared folder location (under SASUniversityEdition/myfolders on your system) if you are using SAS University Edition in a Virtual Machine.
After you do the setup, then you can proceed with the rest of the work in the class.
Cynthia
Hi:
Your first question was about STAT1. Your second question seems to be about Programming 1. ANYTIME you see the string FILEPATH in code, we expect you to replace that string with YOUR location for the class data folder, You showed THIS code:
proc import datafile="filepath/data/eu_sport_trade.xlsx"
DBMS=xlsx
out = eu_sport_trade
replace;
run;
If you are using SAS University Edition in a Virtual Machine and IF you did the data setup for the class correctly, we would expect you to replace "filepath" in the above code with this (first line only displayed):
proc import datafile="/folders/myfolders/EPG194/data/eu_sport_trade.xlsx"
Or, if you are using SAS OnDemand for Academics on our cloud server and IF you did the data setup for the class correctly, we would expect you to replace "filepath" in the above code with this (first line only displayed):
proc import datafile="/home/<yourUserID>/EPG194/data/eu_sport_trade.xlsx"
One way to see the correct full path to use for the eu_sport_trade.xlsx file is to go to your Server Files and Folders pane in SAS Studio. Find your EPG194 folder and click the little triangle/arrow to expand the contents. Find your data subfolder and click to expand the data subfolder. In the folder you should see the eu_sport_trade.xlsx file -- just right-click on the file and choose Properties. In the popup window, you'll see a Location field. The full path you need is shown in this box. All you need to do is highlight the FULL path and do a CTRL+C to get the path and then do a CTRL+V between the quotation marks.
Hope this helps,
Cynthia
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
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.