BookmarkSubscribeRSS Feed
LineMoon
Lapis Lazuli | Level 10

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

9 REPLIES 9
Tom
Super User Tom
Super User

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?

LineMoon
Lapis Lazuli | Level 10

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

Reeza
Super User

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?

LineMoon
Lapis Lazuli | Level 10

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

Reeza
Super User

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?

LineMoon
Lapis Lazuli | Level 10

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

Tom
Super User Tom
Super User

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.

LineMoon
Lapis Lazuli | Level 10

@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.

Tom
Super User Tom
Super User

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?

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

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
  • 9 replies
  • 808 views
  • 0 likes
  • 3 in conversation