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

Hi,

 

I was following the captioned tutorial under the free course  SAS® Programming 1: Essentials. The activity asked to perform as below:

 

 "  Open a new program window and perform the following tasks:

 

  • Write a PROC CONTENTS step to generate a report of the storm_summary.sas7bdat table.
    • SAS Studio: Specify the path to your EPG194/data folder and the full name of the table.
    • Enterprise Guide: Specify &path and the full name of the table.  "

What i did first was that I manually opened the foilder containing the above file from "My Computer" and then got its file directory from its properties. 

 

I then copied the same directory in the Proc Contents step and executed it as per the instructions. SAS code is as below:

proc contents data="E:\SASUniversityEdition\myfolders\EPG194/storm_summary.sas7bdat";
run;

 

Then i got an error message which i have attached as Attachment 1

 

Subsequently I figured out the file location by accessing it through the SAS Studio  and found the location address which I have attached as Attachment 2.  The address is "/folders/myfolders/EPG194/data/storm_summary.sas7bdat" . By copy pasting this address, into the Proc contents code, i could get the summary table.

 

But my question is that why did the original file path which i took from the My Computer did not work and why the other file path which i got from SAS studio only worked. Moreover  the file path mentioned in SAS studio started with /folders, whereas in reality the "My Folders" folder was not created in any such folder by name "folders". 

 

How would a new learner be able to figure out this file path logic ? or how would a new comer be able to write the file path without viewing it through the GUI by clicking the properties ?

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Cynthia_sas
SAS Super FREQ
The original path did NOT work because your Virtual Machine that has SAS is a Unix machine. The Shared Folder location that you created when you installed University Edition is how your Virtual Box software knows where your data is so that SAS, inside the Virtual Machine can use your data.

In the video for how to make the data and in the course, we tell you to find the data folder in SAS Studio and right-click on the folder and choose Properties. The path you need is shown in the Location field of the Properties window.

Later in the course, we will show you how to use a LIBNAME statement so you don't need to keep using the full operating system path. In the future, do not use any part of a Windows, local machine path. The instructions for SAS University Edition, when you made the data, had you do this same right-click and look at Properties to get the correct path for the creation program.

You MUST find the file path when you're starting out by clicking to find the Properties. That's the only absolutely correct way to do it. When you are using SAS on the job, you'll have to do something similar or the data administrator will have to tell you the correct file path.

Cynthia

Cynthia

View solution in original post

6 REPLIES 6
Cynthia_sas
SAS Super FREQ
The original path did NOT work because your Virtual Machine that has SAS is a Unix machine. The Shared Folder location that you created when you installed University Edition is how your Virtual Box software knows where your data is so that SAS, inside the Virtual Machine can use your data.

In the video for how to make the data and in the course, we tell you to find the data folder in SAS Studio and right-click on the folder and choose Properties. The path you need is shown in the Location field of the Properties window.

Later in the course, we will show you how to use a LIBNAME statement so you don't need to keep using the full operating system path. In the future, do not use any part of a Windows, local machine path. The instructions for SAS University Edition, when you made the data, had you do this same right-click and look at Properties to get the correct path for the creation program.

You MUST find the file path when you're starting out by clicking to find the Properties. That's the only absolutely correct way to do it. When you are using SAS on the job, you'll have to do something similar or the data administrator will have to tell you the correct file path.

Cynthia

Cynthia
rguit102
Calcite | Level 5

Im having a similar issue but i have the correct file name and getting this error message

rguit102_0-1589309313430.png

rguit102_1-1589309409263.png

could you let me know what I am doing wrong?

 

VDD
Ammonite | Level 13 VDD
Ammonite | Level 13

you have to use the same / for unix or \ for windows systems.

 


proc contents data="E:\SASUniversityEdition\myfolders\EPG194/storm_summary.sas7bdat";
run;

try this

proc contents data="E:\SASUniversityEdition\myfolders\EPG194\storm_summary.sas7bdat";
run;
Cynthia_sas
SAS Super FREQ

Hi:
You CANNOT use a local Windows path location with SAS University Edition. This will NOT work. When using SAS University Edition, you MUST use the shared folder location, as you see it when you check the Properties for the data folder in SAS Studio. If you followed ALL of our instructions, that path should be:
data="/folders/myfolders/EPG194/data/storm_summary.sas7bdat";

 

and, if you are using SAS OnDemand for Academics and followed all the instructions, the location would be:

data="/home/<yourUserID>/EPG194/data/storm_summary.sas7bdat";

That means if YOUR UserID is imastudent0 then the path would be:

data="/home/imastudent0/EPG194/data/storm_summary.sas7bdat";

 

You can ONLY use a Windows path if you are using SAS or Enterprise Guide with a local install of SAS.

 

Cynthia

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

Mastering the WHERE Clause in PROC SQL

SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 6 replies
  • 4648 views
  • 0 likes
  • 4 in conversation