Export Multiple Data Sets to One Excel work Sheet

Accepted Solution Solved
Reply
Contributor
Posts: 29
Accepted Solution

Export Multiple Data Sets to One Excel work Sheet

Hi All,

Please help with the code to export multiple Data sets to one excel worksheet. I tried it with ODS tagsets.excelxp file = 'myexcel.xml' but helpless to open the file exported since it is in XML format.

For ex : I got Data set names A,B, & C and I want thease three sets to get opened in one excel worksheet into three different tabs names A,B & C.

Please help the best solution since I want it to get opened exclusively in excel worbook only.

Thanks in advance to all.

Sunil


Accepted Solutions
Solution
‎07-11-2013 12:21 PM
Super User
Posts: 17,907

Re: Export Multiple Data Sets to One Excel work Sheet

If you want in different tabs thats different than one worksheet.  I think you mean one workbook.

You can also open an .xml file with excel, so you're doing something wrong.

Assuming you want 3 different tables in different tabs in the same workbook then Proc export can do that, or using libname.

libname sample excel 'myexcel.xls';

data sample.a;

     set a;

data sample.b;

     set b;

data sample.c;

     set c;

run;

libname sample;

View solution in original post


All Replies
Solution
‎07-11-2013 12:21 PM
Super User
Posts: 17,907

Re: Export Multiple Data Sets to One Excel work Sheet

If you want in different tabs thats different than one worksheet.  I think you mean one workbook.

You can also open an .xml file with excel, so you're doing something wrong.

Assuming you want 3 different tables in different tabs in the same workbook then Proc export can do that, or using libname.

libname sample excel 'myexcel.xls';

data sample.a;

     set a;

data sample.b;

     set b;

data sample.c;

     set c;

run;

libname sample;

Contributor
Posts: 29

Re: Export Multiple Data Sets to One Excel work Sheet

Hi Reeza, Perfect this is what exactly I was looking for.... Great!! n Thanks

Sunil

☑ This topic is solved.

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

Discussion stats
  • 2 replies
  • 2666 views
  • 0 likes
  • 2 in conversation