Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

SAS 9 export into Excel 2003

SAS 9 export into Excel 2003

SAS 9 export into Excel 2003

I'm currently trying to get SAS 9 to export to Excel 2003 on a specific tab without using DDE.

I've scoured the net and got as far as the below:

libname myxls "c:\update.xls";
data myxls.data;
set work.update2;

libname myxls clear;

This will add all the headers in the update2 dataset to the correct Excel file and tab in the workbook, but, no data sad

Does anyone know how to do this?  Any help you can provide would be greatly appreciated and will more than likely stop me hitting my head on a wall!! winky smile

RE: SAS 9 export into Excel 2003

Why not use PROC EXPORT?

RE: SAS 9 export into Excel 2003

Hi Klaz2002

I need to output 2 different datasets to the same excel sheet on  different tabs.  

Is this possible in a proc export?

RE: SAS 9 export into Excel 2003

You could look into doing a proc append into a XL sheet..

RE: SAS 9 export into Excel 2003

May I suggest: thread376-1335588: export to multiple excel tabs: export to multiple excel tabs.

It's a bit long and the solution worked for SAS 8 on zOS.  Unfortunately, I haven't work with SAS or the mainframe for quite some time and wouldn't be able to assist.  Hopefully you'll be able to find enough information to help you accomplish your goal.

RE: SAS 9 export into Excel 2003

Thanks all for your help.  I managed to get it to work with the following code:

LIBNAME wrkbk EXCEL 'c:\update.xls';

/*deletes existing named range in Excel to allow overwriting in the next step*/

proc datasets lib = wrkbk;
delete data;

/*Exports data to excel and creates data named range (and tab if it doesn't exist already)*/

data wrkbk.data;
set update2;

/*Clears libname to allow the Excel file to open, without this the file would be locked*/

libname wrkbk clear;


RE: SAS 9 export into Excel 2003

Glad you got it sorted out.  Thanks for posting the solution for others.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close