sas export

Reply
Super Contributor
Posts: 371

sas export

Hello,

I have a datas and I want to explort it,

In sas the export to xls  is succesful, but i I cant open my file by export; why ?

any solution

Super User
Super User
Posts: 6,383

Re: sas export

Why did you make XLS instead of XLSX? 

Did you not find the XLS file?  What does the SAS log say about where it wrote the file?

Do you even have Microsoft Excel installed to allow you to read an XLS file?

Super Contributor
Posts: 371

Re: sas export

Why did you make XLS instead of XLSX?  for this test, I have used XLSX


Did you not find the XLS file?  Yes, when I use import on file export, I find all my datas

What does the SAS log say about where it wrote the file? the export was successful

Do you even have Microsoft Excel installed to allow you to read an XLS file? Yes

Note : I click, on .xls file, it does not open it

Grand Advisor
Posts: 17,464

Re: sas export

Please don't double post:

Also, please take the time to ask a detailed question. In a lot of your questions people have to ask for more details and try and determine what your asking in the first place.  It's a bit of a waste of our, help us help you. Please review the following posts for more information on how to phrase your questions:

http://stackoverflow.com/help/how-to-ask

In this particular question, why doesn't it work?

How doesn't it work? Do you get an error, if so what does it say?

Why are you using XLS instead of XLSX?

What was your proc export code?

What version of SAS are you using? Is it 32 vs 64 bit?

What version of Excel do you have and is it 32 vs 64 bit?

Super Contributor
Posts: 371

Re: sas export

Sorry, I will try to do the best

To answer to yours questions

In this particular question,

why doesn't it work?  Ifor the moment, I do not know

How doesn't it work?  I do not understand, what do you mean

Do you get an error, if so what does it say? no, I have no error, it sends a message who says, the export was successful.

Why are you using XLS instead of XLSX?  Do you prefere the XLSX ?

What was your proc export code?

proc export data=toto

dbms=xls

  outfile='c:\dir\class.xls'

replace;

run;

What version of SAS are you using? Is it 32 vs 64 bit?  64 bit

What version of Excel do you have and is it 32 vs 64 bit? 64 bit

Grand Advisor
Posts: 17,464

Re: sas export

You say you've used XLSX but your code shows XLS?

When you try and open the excel file what happens? Do you get an error there?

HAve you tried different DBMS options - EXCEL or XLSX?

Super Contributor
Posts: 371

Re: sas export

You say you've used XLSX but your code shows XLS?

non, I have used XLS

When you try and open the excel file what happens?

I get a message likes this message posted before here, but for xlsx, but for me, it is xls :

Do you get an error there?

non

HAve you tried different DBMS options - EXCEL or XLSX?

I think, I have tried EXCEL, but it does not work.

XLSX not yet

Super User
Super User
Posts: 6,383

Re: sas export

What happens when you try to open the file from within Excel using the FILE->OPEN menu?

How are you running SAS?  For example if you are running SAS by using Enterprise Guide then perhaps the SAS program is running on a different computer.

SAS should actually say exactly where it wrote the file, you can copy and paste from the log into the file selection tool in Excel to make sure that you are trying to open the same file.

193   proc export data=sashelp.class file='c:\downloads\class.xlsx' dbms=xlsx ;

194   run;

NOTE: The export data set has 19 observations and 5 variables.

NOTE: "c:\downloads\class.xlsx" file was successfully created.

Super Contributor
Posts: 371

Re: sas export

@tom: thank you for your message

What happens when you try to open the file from within Excel using the FILE->OPEN menu?

=====>I have not tried  to open the file from within Excel using the FILE->OPEN menu. I will try and give you the answer later.

For the moment to open it, I click on  the .xls file.

How are you running SAS?  For example if you are running SAS by using Enterprise Guide then perhaps the SAS program is running on a different computer.

SAS should actually say exactly where it wrote the file, you can copy and paste from the log into the file selection tool in Excel to make sure that you are trying to open the same file.

====> I run sas on unix and I use the Enterprise Guide, but the program, I run, it runs only by me.

Super User
Super User
Posts: 6,383

Re: sas export

So if it runs on UNIX then

1) It will not write a file with a name like 'c:\dir\class.xls' since Unix filenames will look instead like '/dir/class.xls' .

2) You will need to either have the directory that Unix writes to cross mounted to your PC or use some software such as FTP to move the file to your PC.

     Are you sure that the file is being moved to your PC as a BINARY file?  If FTP moves the file as a text file then it will insert extra carriage returns and those will ruin the binary structure of an XLS file.

3) Or perhaps you are using a SAS PC Files Server that the Unix SAS program can connect to and write a file in Excel format?  Where is that server running? Is it on your PC or some other PC on the network?

You should be able to paste the lines from your SAS log with the PROC EXPORT command as I have done above.

If you do not have such lines in your SAS log then perhaps you are not using PROC EXPORT at all?  Are you using an Export Task in Enterprise Guide?

Ask a Question
Discussion stats
  • 9 replies
  • 297 views
  • 0 likes
  • 3 in conversation