BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
agabru0
Fluorite | Level 6
when execute the code below the file fails to open as an excel file. 
Make,Model,Type,Origin,DriveTrain,MSRP,Invoice,EngineSize,Cylinders,Horsepower,MPG_City,MPG_Highway,Weight,Wheelbase,Length
Acura,MDX,SUV,Asia,All,"$36,945","$33,337",3.5,6,265,17,23,4451,106,189      


proc export data=sashelp.cars
outfile=_dataout
dbms=csv replace;
run;

%let _DATAOUT_MIME_TYPE=text/csv;
%let _DATAOUT_NAME=cars.csv;
1 ACCEPTED SOLUTION

Accepted Solutions
agabru0
Fluorite | Level 6

dbms=xlsx is not working because i have excel 7 and the file extension is xls. is ther a work around

View solution in original post

8 REPLIES 8
Reeza
Super User
Well, you're not generating an Excel file, you're generating a CSV, it can open in Excel or in a text editor or a browser these days as well. I'm guessing the browser is opening it directly?

PS. Please don't post your text in a code block, it sort of defeats the purpose of a code block when you put text and it makes less legible since it forces you to scroll to the side to read it all.
agabru0
Fluorite | Level 6

how do I overcome the problem, 

agabru0
Fluorite | Level 6

In SAS Studio I need the output in excel, not CSV. I've tried changing CSV to XLS in the code below but it didn't work 

Reeza
Super User

Change DBMS to XLSX and try making sure you have a file extension. I wasn't sure if you were using some other sort of output process giving your filename. 

 


@agabru0 wrote:

In SAS Studio I need the output in excel, not CSV. I've tried changing CSV to XLS in the code below but it didn't work 


 

agabru0
Fluorite | Level 6

I have MS office (excel 7) installed so I cant use DBMS=XLSX.  Is there another workaround? 

andreas_lds
Jade | Level 19

@agabru0 wrote:

I have MS office (excel 7) installed so I cant use DBMS=XLSX.  Is there another workaround? 


Please post the log with the error message showing that dbms=xlsx is working.

agabru0
Fluorite | Level 6

dbms=xlsx is not working because i have excel 7 and the file extension is xls. is ther a work around

Peter_C
Rhodochrosite | Level 12
Upgrade your office

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 8 replies
  • 5431 views
  • 1 like
  • 4 in conversation