The SAS Output Delivery System and reporting techniques

SAS data to excel

Accepted Solution Solved
Reply
Contributor
Posts: 69
Accepted Solution

SAS data to excel

Hello expert,

 

I tried to handle it by reading and trying a lot but NO success. I want to export my output sas data to excel, the answer I got in log is

Physical file does not exist and I do not understand the problem. I am using SAS 9.2.

 

The program is:

ODS CSV FILE='C:\Temp\family.CSV';

proc means data=sasuser.sasfile120416;

var dp dq ee dr;

run;

ODS CSV CLOSE;

 

I appreciate any help,

 

Thanks a lot

 

 


Accepted Solutions
Solution
‎04-18-2016 08:10 AM
Super User
Posts: 7,863

Re: SAS data to excel

Then let's dig deeper into the setup and what possibly happens:

 

Your client software (most likely Enterprise Guide) can see your local drive(s) and does handle all the transfer stuff for you. Importing and exporting with EG tasks works well.

Your SAS code runs exclusively on the server, which does not have access to your local drive(s), and so you can't do import/export strictly from code as you would have believed it to be.

 

Remedy one: keep using the EG tasks for import/export

Remedy two: see if there is a shared network resource available that both your desktop and the SAS server have access to, and store your Excel files there

Remedy three: Use a file transfer tool like WinSCP to transfer files from your desktop to the server.

---------------------------------------------------------------------------------------------
Maxims of Maximally Efficient SAS Programmers

View solution in original post


All Replies
Super User
Posts: 7,863

Re: SAS data to excel

[ Edited ]

Please post the relevant portion of the log.

What is your SAS setup?

University Edition, SAS On Demand, or Licensed?

Single machine, or client/server?

If C/S, which server operating system?

 

Gosh, just read it, you're on 9.2, so it can't be UE or On Demand. The other questions are still relevant, though.

---------------------------------------------------------------------------------------------
Maxims of Maximally Efficient SAS Programmers
Contributor
Posts: 69

Re: SAS data to excel

Posted in reply to KurtBremser

I am a student and this is SAS via the universty, My operating server is Windows 8.1

 

I am new in SAS so maybe it sounds like stupid question, but maybe the result is to save the data of the "result window" in WORK library and then to export it to EXCEL file, NO?

 

Thanks for any comments :-)

Super User
Posts: 7,863

Re: SAS data to excel

I'm still missing the log Smiley Wink

Since that is the main source for debugging, I can't be of much help without it.

---------------------------------------------------------------------------------------------
Maxims of Maximally Efficient SAS Programmers
Contributor
Posts: 69

Re: SAS data to excel

Posted in reply to KurtBremser

please...

1 ODS CSV FILE='C:\Temp\family.CSV';

NOTE: Writing CSV Body file: C:\Temp\family.CSV

ERROR: Physical file does not exist, C:\Temp\family.CSV.

WARNING: No body file. CSV output will not be created.

2 proc means data=sasuser.sasfile120416;

3 var dp dq ee dr;

4 run;

NOTE: There were 8392 observations read from the data set SASUSER.SASFILE120416.

NOTE: PROCEDURE MEANS used (Total process time):

real time 0.06 seconds

cpu time 0.03 seconds

 

5 ODS CSV CLOSE

 

 

 

Super User
Posts: 7,863

Re: SAS data to excel

OK, so it's verified that not only your client, but your server runs on Windows. Otherwise the ERROR message would have contained parts of a UNIX file path.

So the most likely scenario is that your SAS runs on a remote server that naturally can't see your C:\temp, as this is local to your desktop computer. Am I guessing right?

---------------------------------------------------------------------------------------------
Maxims of Maximally Efficient SAS Programmers
Contributor
Posts: 69

Re: SAS data to excel

Posted in reply to KurtBremser

"Am I guessing right?"

The answer: Yes :-(

Contributor
Posts: 69

Re: SAS data to excel

But I also have to say that I succeed to import excel file to SAS
Solution
‎04-18-2016 08:10 AM
Super User
Posts: 7,863

Re: SAS data to excel

Then let's dig deeper into the setup and what possibly happens:

 

Your client software (most likely Enterprise Guide) can see your local drive(s) and does handle all the transfer stuff for you. Importing and exporting with EG tasks works well.

Your SAS code runs exclusively on the server, which does not have access to your local drive(s), and so you can't do import/export strictly from code as you would have believed it to be.

 

Remedy one: keep using the EG tasks for import/export

Remedy two: see if there is a shared network resource available that both your desktop and the SAS server have access to, and store your Excel files there

Remedy three: Use a file transfer tool like WinSCP to transfer files from your desktop to the server.

---------------------------------------------------------------------------------------------
Maxims of Maximally Efficient SAS Programmers
Contributor
Posts: 69

Re: SAS data to excel

Posted in reply to KurtBremser

ok, I will check it and BIG BIG THANKS !Smiley Happysmileyhappy:

☑ This topic is solved.

Need further help from the community? Please ask a new question.

Discussion stats
  • 9 replies
  • 687 views
  • 0 likes
  • 2 in conversation