DATA Step, Macro, Functions and more

Macro to export sas dataset to Excel

Accepted Solution Solved
Reply
New Contributor
Posts: 2
Accepted Solution

Macro to export sas dataset to Excel

Is there a simple macro out there that exports output of a sas dataset to excel? Note: I am using SAS EG 4.3 so unable to use PROC EXPORT.


Accepted Solutions
Solution
‎01-14-2016 01:56 PM
Super User
Posts: 17,796

Re: Macro to export sas dataset to Excel

You should be able to use PROC EXPORT, unless you don't have a license for it, or you're on a server and can't proc export to your local drive which is what you're trying to do.

 

Regardless, there is a macro that may work for you, see code/paper here:

http://www.sascommunity.org/wiki/A_Poor/Rich_SAS_Users_Proc_Export

 

If it is the server issue, see this post:

http://blogs.sas.com/content/sasdummy/2012/12/06/copy-files-in-sas-eg/

View solution in original post


All Replies
Solution
‎01-14-2016 01:56 PM
Super User
Posts: 17,796

Re: Macro to export sas dataset to Excel

You should be able to use PROC EXPORT, unless you don't have a license for it, or you're on a server and can't proc export to your local drive which is what you're trying to do.

 

Regardless, there is a macro that may work for you, see code/paper here:

http://www.sascommunity.org/wiki/A_Poor/Rich_SAS_Users_Proc_Export

 

If it is the server issue, see this post:

http://blogs.sas.com/content/sasdummy/2012/12/06/copy-files-in-sas-eg/

Super User
Super User
Posts: 7,401

Re: Macro to export sas dataset to Excel

What do you want the Excel files?  Are you trying to create some review output files?  If so then I would first recommend using a report format - proc report to PDF or RTF for instance, although if they insist on Excel, then ods tagsets.excelxp (google for results).

 

If you are transferring data, then don't use Excel, it is not useful in any way as a data transfer format.  Use Comma Separated Variable format.

☑ This topic is SOLVED.

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

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