Help using Base SAS procedures

How to export Excel file (.xls or .xlsx) from my SAS data set in 9.3 SAS version?

Accepted Solution Solved
Reply
Super Contributor
Posts: 319
Accepted Solution

How to export Excel file (.xls or .xlsx) from my SAS data set in 9.3 SAS version?

Hi, all:

 

I'm currently using SAS 9.3 version.   I would like to export my SAS data to Excel format (.xls or .xlsx), not CSV format.  Please help, thanks.

 

Y


Accepted Solutions
Solution
‎04-19-2016 11:13 AM
Frequent Contributor
Posts: 123

Re: How to export Excel file (.xls or .xlsx) from my SAS data set in 9.3 SAS version?

Use proc export:

 

proc export 
  data=dataset
  dbms=xlsx
  outfile="C:\temp\myfile.xlsx"
  replace;
run;

View solution in original post


All Replies
Solution
‎04-19-2016 11:13 AM
Frequent Contributor
Posts: 123

Re: How to export Excel file (.xls or .xlsx) from my SAS data set in 9.3 SAS version?

Use proc export:

 

proc export 
  data=dataset
  dbms=xlsx
  outfile="C:\temp\myfile.xlsx"
  replace;
run;
Super User
Posts: 7,799

Re: How to export Excel file (.xls or .xlsx) from my SAS data set in 9.3 SAS version?

You will have a much easier life in the future if you use an open, textual format for the data transfer (as long as you only do that; for reports with formatting ODS TAGSETS.EXCELXP is of course the way to go).

Why do I say that?

MS is prone to make changes in their formats and how Excel treats data from version to version, giving one severe headaches. The import/export from/to CSV has worked all the time (in my experience).

Another reason is that you can debug a CSV file with a simple text editor. Even though XLSX is zipped XML and not binary, manually looking for problems can be a major PITA.

Third reason: CSV can be used to transfer the data to ANY system that is more suited for BI than Excel.

---------------------------------------------------------------------------------------------
Maxims of Maximally Efficient SAS Programmers
Super Contributor
Posts: 319

Re: How to export Excel file (.xls or .xlsx) from my SAS data set in 9.3 SAS version?

Posted in reply to KurtBremser

I need to upload the Excel file to our internal website, it wouldn't recognized the CSV format, only .xls and .xlsx. 

☑ This topic is solved.

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

Discussion stats
  • 3 replies
  • 311 views
  • 2 likes
  • 3 in conversation