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

I have a SAS dataset in my downloads folder that I need to write a program against. I cannot get the path correct to access the dataset. However, if I go into my file manager and double click the dataset it opens in my SAS EG project and I can see all the contents. I cannot reference it in my project or program to run a proc contents against it. Is there a way to get it into my work folder?

1 ACCEPTED SOLUTION

Accepted Solutions
Tom
Super User Tom
Super User

Right click on the file you see in the File explorer panel and the left and you should be able to get the properties to show you the actual path of the file.

 

To reference a dataset by directly using the path of the file you have to enclose the path in quotes.

proc contents data="/...../..../membername.sas7bdat";
run;

Or define a libref that points to the directory that holds the file and use a two level name.

libname mydata "/...../..../";
proc contents data=mydata.membername ;
run;

View solution in original post

14 REPLIES 14
tom_grant
SAS Super FREQ
Have you assigned a Library to the folder?
Ex
Libname MyDL "C:\users\myID\downloads";
michellemc
Calcite | Level 5

That is exactly what I'm doing and getting a file not found error.

 

libname a "C:/users/micchelle/downloads";
run;


data vila;
set a.vila_health_los_readmission;
run;

michellemc
Calcite | Level 5

Is there a way once I open the dataset in SAS EG to save it to the project?

michellemc
Calcite | Level 5

I changed the direction of my back slashes and continue to get the file not found error.

 

libname a "C:\users\micchelle\downloads";
run;


data vila;
set a.vila_health_los_readmission;
run;

tom_grant
SAS Super FREQ
Just run Libname statement & send log
Quentin
Super User

Hi,

 

Enterprise Guide is often running on your PC, but it works by connecting to a SAS session, and usually that SAS session is on a server (often a linux server).  One challenge in that setup is that if your SAS code is running on a server, that server can't see your local C: drive.  It can be a bit confusing because EG can see your local C: drive, but SAS can't.

 

If you're using EG connected to a server, then typically you need to upload local data from your C drive to the server (or to somewhere the server can see it).  EG has a COPY FILES task which can be used to copy a file from your local file, to the server.  This blog post describes that tool.  https://blogs.sas.com/content/sasdummy/2020/05/19/copy-files-in-sas-eg/

 

Do you know if your EG is connected to SAS running on a server?  Do you know if you have personal space on the server?  Do you know the path for your personal space?

BASUG is hosting free webinars Next up: Don Henderson presenting on using hash functions (not hash tables!) to segment data on June 12. Register now at the Boston Area SAS Users Group event page: https://www.basug.org/events.
michellemc
Calcite | Level 5

Now I understand what you're saying but I can't figure out how to copy the file (despite your links). I am connecting to a SAS Server United States 2 through SAS OnDemand for Academics.

Quentin
Super User

I'm not familiar with SODA, but I think it might be easier to use it with SAS Studio instead of Enterprise Guide. 

 

I found these instructions on how to upload data to the SODA server via Studio:

https://support.sas.com/content/dam/SAS/support/en/products-solutions/ondemand/LocalData2022.pdf

 

At the end there is a note with a link to EG documentation which says it can temporarily (?) upload data with File->Open, but it's not clear to me.  I only use EG to submit SAS code.  If you're starting new with SODA, I would use Studio, unless you have a good reason for using Enterprise Guide.

BASUG is hosting free webinars Next up: Don Henderson presenting on using hash functions (not hash tables!) to segment data on June 12. Register now at the Boston Area SAS Users Group event page: https://www.basug.org/events.
michellemc
Calcite | Level 5

I'm making slow progress. I found the copy file command and now I'm getting an error that it can't find the destination folder. I have tried substituting my user id and still get destination not found.

michellemc_0-1681504976970.png

 

Quentin
Super User

Maybe try /home/&sysuserid/Data as the destination.  That's just a guess. Hopefully someone else who has used SODA will be able to help out and explain how the home directories are structured on the SODA server.

BASUG is hosting free webinars Next up: Don Henderson presenting on using hash functions (not hash tables!) to segment data on June 12. Register now at the Boston Area SAS Users Group event page: https://www.basug.org/events.
Reeza
Super User
Bad workaround idea, go to your work library and select properties and get the path. You should be able to upload the file there if you can't find your location.

I'm not familiar with EG on SODA either, only Studio.
Reeza
Super User
If you can show a screenshot of the Explorer Window may be able to help show you where you can save data.
michellemc
Calcite | Level 5

I changed to SAS Studio on Demand for Academics and the file uploaded. Now I need help accessing it. I can see it, but I'm not sure the correct path. I'm getting a file not found error. 

 

michellemc_0-1681512870060.png

 

Tom
Super User Tom
Super User

Right click on the file you see in the File explorer panel and the left and you should be able to get the properties to show you the actual path of the file.

 

To reference a dataset by directly using the path of the file you have to enclose the path in quotes.

proc contents data="/...../..../membername.sas7bdat";
run;

Or define a libref that points to the directory that holds the file and use a two level name.

libname mydata "/...../..../";
proc contents data=mydata.membername ;
run;

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!

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 14 replies
  • 1879 views
  • 8 likes
  • 5 in conversation