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-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

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
  • 8 replies
  • 5160 views
  • 1 like
  • 4 in conversation