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

Hello all.  I am trying to do a simple ods from SAS Studio to my computer and keep getting the error that the Physical file does not exist.

 

My code:

data soccer;
input Team : $20. Wins Losses;
datalines;
Readington 20 3
Raritan 10 10
Branchburg 3 18
Somerville 5 18
;

options nodate nonumber;
title;
ods listing close;
ods csv file ='C:/Users/admin/Documents/soccer.csv';
proc print data=soccer noobs;
run;
ods csv close;
ods listing;

 

The file extension is what other CSV files that I already have on my computer have as their file extensions, except for the soccer.csv portion.

 

Is there something I am doing wrong?

 

Thanks for any help you can provide.

 

Adam

1 ACCEPTED SOLUTION

Accepted Solutions
Tom
Super User Tom
Super User

Do you have a full version of SAS installed on your PC?  Or are you working with the free SAS University Edition?

 

The path you have in your code 'C:/Users/admin/Documents/soccer.csv' looks somewhat like a Windows PC file location because it starts with C:.  But it is using slashes that go in the wrong direction.  Normally SAS will fix the slashes for you. But for that to work SAS itself must be running on the Windows machine where that C:\Users\admin\Documents\ directory exists.  If you are using the SAS UE edition then SAS is running in a virtual machine so it cannot see you C: drive.  It can only see the folder that you mapped to the /folders/myfolders path in the virtual machine.  Or if SAS is running on some other server in your environment then that path might not exist.

 

Even if you are running SAS on your machine and that path exists you might not have permission to make a new file there. Especially since the path seems to be for a user name ADMIN.

View solution in original post

11 REPLIES 11
Tom
Super User Tom
Super User

Do you have a full version of SAS installed on your PC?  Or are you working with the free SAS University Edition?

 

The path you have in your code 'C:/Users/admin/Documents/soccer.csv' looks somewhat like a Windows PC file location because it starts with C:.  But it is using slashes that go in the wrong direction.  Normally SAS will fix the slashes for you. But for that to work SAS itself must be running on the Windows machine where that C:\Users\admin\Documents\ directory exists.  If you are using the SAS UE edition then SAS is running in a virtual machine so it cannot see you C: drive.  It can only see the folder that you mapped to the /folders/myfolders path in the virtual machine.  Or if SAS is running on some other server in your environment then that path might not exist.

 

Even if you are running SAS on your machine and that path exists you might not have permission to make a new file there. Especially since the path seems to be for a user name ADMIN.

BoboTheFool
Calcite | Level 5

I am running SAS Studio on my PC.  The admin is me, I just never changed the admin name, and left it as is.  I have changed the direction of the slashes as well, and then it gives me a permission error as well.  I don't have SAS actually downloaded on my computer, and am using SAS Studio through my university.  I am pretty certain it may be the university edition as I connect to it through the SAS website.  If SAS UE cannot see my C drive, how do I use ods to send a file to my computer?  All of the code is for a problem in my textbook, and the only thing we had to change was the file nomenclature, but my understanding is that it has to go to our computer so we can then open it as a CSV file in Excel.

BoboTheFool
Calcite | Level 5

When I change the direction of the slashes in the filepath name, this is what I get:

 

81         options nodate nonumber;
82         title;
83         ods listing close;
84         ods csv file ='C:\Users\admin\Documents\soccer.csv';
NOTE: Writing CSV Body file: C:\Users\admin\Documents\soccer.csv
ERROR: Insufficient authorization to access /pbr/biconfig/940/Lev1/SASApp/C:\Users\admin\Documents\soccer.csv.
ERROR: No body file. CSV output will not be created.
85         proc print data=soccer noobs;
86         run;
BoboTheFool
Calcite | Level 5

Thanks Kurt - that's what I am finding out.  I'm not sure I see the purpose of exporting it the VM and then importing it back again, but that looks like the workaround for it.  I appreciate everyone's help on this.

Kurt_Bremser
Super User

With a VM (University Edition), you have a shared folder to communicate, where you use a Windows path name when putting files there or retrieving them, and use the UNIX path name from SAS.

In a client/server environment, you need to use another means to put your data in reach of SAS. Either by using a file transfer utility like WinSCP or sftp, or by using a shared network resource that is available both on the client and the server.

In both cases, it is necessary to use UNIX-style path syntax from within SAS.

BoboTheFool
Calcite | Level 5
Thanks Tom - my professor gave us a workaround for the issue.
pb82477
Fluorite | Level 6

You mentioned that your professor provided a work-around. Would you mind posting it for the rest of the community? Thanks.

BoboTheFool
Calcite | Level 5

Sorry it took so long to return with the workaround, but here it is:

 

Right click your own file folder in SAS (mine is sasuser.v94) and you can "upload files" from your PC.

Bhavya3
Calcite | Level 5

Hey, the upload file option is not working for an excel file on my computer. I'm using a mac

SAS Innovate 2025: Register Now

Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!

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
  • 11 replies
  • 17004 views
  • 1 like
  • 5 in conversation