BookmarkSubscribeRSS Feed
Ronein
Meteorite | Level 14

Hello

This code export 5 tables to one excel sheet and put them as a panel (3 side by side and then 2 side by side).

I want to adjust the code to export 3 tables to "sheet1"  that will be side by side and 2 tables to "sheet2" that will be side by side

 

 


/*Create panel of tables in one excel file and one sheet*/

ods tagsets.msoffice2k_x
file="/usr/local/SAS/MidulOld/UserDir/Ron.xls"
options(panelcols="3")
style=normal;
proc print data=sashelp.prdsale(obs=3);
var actual predict country region;
where country="CANADA";
title "Canada Sales";
run;
proc print data=sashelp.prdsale(obs=3);
var actual predict country region;
where country="U.S.A.";
title "USA Sales";
run;
proc print data=sashelp.prdsale(obs=3);
var actual predict country region;
where country="GERMANY";
title "Germany Sales";
run;

ods tagsets.msoffice2k_x
options(panelcols="2") ;
proc print data=sashelp.prdsale(obs=3);
where region="EAST";
title "East Sales";
run;
proc print data=sashelp.prdsale(obs=3);
where region="WEST";
title "West Sales";
run;

ods tagsets.msoffice2k_x close;

6 REPLIES 6
Ronein
Meteorite | Level 14

Can you please send a code and we will see together that it works.

I tried to do what you said but it didn't work

 

Ronein
Meteorite | Level 14

I run this code in order to get to sheets (sheet1, sheet2).

But I got for each table a seperate sheet!!

 

 

 

 

ods tagsets.excelxp file="/usr/local/SAS/MidulOld/UserDir/Ron.xls"

/*Sheet1*/
options(sheet_name='Sheet1' panelcols="3") ;
proc print data=sashelp.prdsale(obs=3)noobs;
var actual predict country region;
where country="CANADA";
title "Canada Sales";
run;
proc print data=sashelp.prdsale(obs=3)noobs;
var actual predict country region;
where country="U.S.A.";
title "USA Sales";
run;
proc print data=sashelp.prdsale(obs=3)noobs;
var actual predict country region;
where country="GERMANY";
title "Germany Sales";
run;


/*Sheet2*/
ods tagsets.excelxp options(sheet_name='Sheet2' panelcols="2");
proc print data=sashelp.prdsale (obs=3)noobs ;
where region="EAST";
title "East Sales";
run;
proc print data=sashelp.prdsale (obs=3)noobs;
where region="WEST";
title "West Sales";
run;
ods tagsets.excelxp close;

Ronein
Meteorite | Level 14

Where can i find your code?I don't understand you

you said "Use my code provided in the other thread to create a side-by-side dataset."

Where is it please?

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 16. Read more here about why you should contribute and what is in it for you!

Submit your idea!

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
  • 6 replies
  • 1308 views
  • 0 likes
  • 2 in conversation