The SAS Output Delivery System and reporting techniques

export multiple tables to one excel file with one sheet (tables are side by side each other)

Reply
Frequent Contributor
Posts: 91

export multiple tables to one excel file with one sheet (tables are side by side each other)

Hello

I want to print 3 tables  side by side in one excel sheet.

When I run my code 3 different excel sheets are created but I want to have only one sheet.

 

 

ods path work.temptemp(update) sasuser.templat(update)
sashelp.tmplmst(read);
ods path show;
ods tagsets.excelxp file="/usr/local/SAS/MidulOld/UserDir/Example.xls"
style=htmlblue;

 

ods tagsets.excelxp options(embedded_titles='yes'
sheet_interval='none' sheet_name='tables'
absolute_column_width="12,13");
Title;
proc print data=a1 noobs label;
Run;
Data a1;
input x y;
cards;
1 10
2 20
3 30
;
Run;

ods tagsets.excelxp options(embedded_titles='yes'
sheet_interval='none' sheet_name='tables'
absolute_column_width="12,13");
Title;
proc print data=a1 noobs label;
Run;
Data a2;
input x y;
cards;
4 10
5 20
6 30
;
Run;

ods tagsets.excelxp options(embedded_titles='yes'
sheet_interval='none' sheet_name='tables'
absolute_column_width="12,13");
Title;
proc print data=a1 noobs label;
Run;
Data a3;
input x y;
cards;
7 10
8 20
9 30
;
Run;

 

 

 

Frequent Contributor
Posts: 91

export multiple tables to one excel file with one sheet (tables are side by side each other)

Hello

I want to export  3 tables  to one excel file with one sheet only where tables are  side by side .

When I run my code 3 different excel sheets are created but I want to have only one sheet.

 

 

ods path work.temptemp(update) sasuser.templat(update)
sashelp.tmplmst(read);
ods path show;
ods tagsets.excelxp file="/usr/local/SAS/MidulOld/UserDir/Example.xls"
style=htmlblue;

 

ods tagsets.excelxp options(embedded_titles='yes'
sheet_interval='none' sheet_name='tables'
absolute_column_width="12,13");
Title;
proc print data=a1 noobs label;
Run;
Data a1;
input x y;
cards;
1 10
2 20
3 30
;
Run;

ods tagsets.excelxp options(embedded_titles='yes'
sheet_interval='none' sheet_name='tables'
absolute_column_width="12,13");
Title;
proc print data=a1 noobs label;
Run;
Data a2;
input x y;
cards;
4 10
5 20
6 30
;
Run;

ods tagsets.excelxp options(embedded_titles='yes'
sheet_interval='none' sheet_name='tables'
absolute_column_width="12,13");
Title;
proc print data=a1 noobs label;
Run;
Data a3;
input x y;
cards;
7 10
8 20
9 30
;
Run;

 

 

 

Super User
Posts: 10,609

Re: export multiple tables to one excel file with one sheet (tables are side by side each other)

Check       tagsets.msoffice2k_x

Super User
Posts: 22,818

Re: export multiple tables to one excel file with one sheet (tables are side by side each other)

ODS TAGSETS does not support tables side by side. 

 

You can use ODS MSOFFICE_2K as suggested by @Ksharp or you can use a PROC EXPORT to a specific range that you can pre-calculate. 

 

 

 

 

Ask a Question
Discussion stats
  • 3 replies
  • 421 views
  • 0 likes
  • 3 in conversation