BookmarkSubscribeRSS Feed
Ronein
Meteorite | Level 14

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;

 

 

 

3 REPLIES 3
Ronein
Meteorite | Level 14

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;

 

 

 

Reeza
Super User

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. 

 

 

 

 

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 3 replies
  • 2205 views
  • 0 likes
  • 3 in conversation