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

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

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
  • 2233 views
  • 0 likes
  • 3 in conversation