BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
snip
Obsidian | Level 7
I am facing an obstacle while creating a report, and I need your assistance, please. My current program generates the arrays successively. However, I would like the flexibility to arrange them according to my preferences. For example, in the first tab, I would like to place tables 1 and 2 side by side, and then the third table below those. In short, I want to be able to arrange the tables at my convenience on an Excel sheet.

Unfortunately, my attempts so far have not been successful. I tried using "ods layout", but apparently the syntax I used was not correct.
ods excel file='c:\example6.xlsx'
 
options( /*autofilter = "1-3" frozen_headers = "on" frozen_rowheaders = "1"*/ start_at='C3' sheet_interval='none' sheet_name='Cl');
proc report data=sashelp.class;
column age height weight;
define age / group;
define height / mean;
define weight / mean;
rbreak before / summarize; run;
proc report data=sashelp.class;
column sex height weight;
define sex / group;
define height / mean;
define weight / mean;
rbreak before / summarize;
run;
proc tabulate data=sashelp.class;
    class sex age;
    table sex,age;
run;
 
ods excel options(sheet_interval='output');
ods exclude all;
data _null_;
declare odsout obj();
run;
ods select all;
 
/*******************************************************************/
ods excel options(sheet_interval='none' sheet_name='H');
proc report data=sashelp.heart;
column bp_status height weight;
define bp_status / group;
define height / mean;
define weight / mean;
rbreak before / summarize;
run;
proc report data=sashelp.heart;
column sex height weight;
define sex / group;
define height / mean;
define weight / mean;
rbreak before / summarize;
run;
 
ods excel options(sheet_interval='output');
ods exclude all;
data _null_;
declare odsout obj();
run;
ods select all;
/*******************************************************************/
 
ods excel options(sheet_interval='none' sheet_name='ttt');
proc report data=sashelp.heart;
column bp_status height weight;
define bp_status / group;
define height / mean;
define weight / mean;
rbreak before / summarize;
run;
proc report data=sashelp.heart;
column sex height weight;
define sex / group;
define height / mean;
define weight / mean;
rbreak before / summarize;
run;
ods excel close;

 

1 ACCEPTED SOLUTION

Accepted Solutions
snip
Obsidian | Level 7
Hello Miller,
Your idea is great...
I think I can modify my data to have all of my data on the same table and add the Gap column.
Thank you very much your help is precious
ods excel file='c:\example6.xlsx' 

options( /*autofilter = "1-3" frozen_headers = "on" frozen_rowheaders = "1" */start_at='C3' sheet_interval='none' sheet_name='C5');
proc format;
    value gapf .,low-high=' ';
run;
proc report data=sashelp.class;
column age height gap weight;
define age / group; 
define height / mean; 
define weight / mean; 
define gap / ' ' style(column)={BORDERTOPCOLOR=white BORDERBOTTOMCOLOR=white background=white } ;
define gap/'' format=gapf. style(header)={background=white BORDERBOTTOMCOLOR=white BORDERTOPCOLOR=white};
rbreak before / summarize; run;

 

View solution in original post

3 REPLIES 3
PaigeMiller
Diamond | Level 26

ODS EXCEL does not have the capability of positioning reports (or graphics) side by side.

 

You could try to produce side-by-side reports all within PROC REPORT (although this may not be possible depending on what the reports are) and having PROC REPORT produce blank columns between.

--
Paige Miller
snip
Obsidian | Level 7
Hello Miller,
Your idea is great...
I think I can modify my data to have all of my data on the same table and add the Gap column.
Thank you very much your help is precious
ods excel file='c:\example6.xlsx' 

options( /*autofilter = "1-3" frozen_headers = "on" frozen_rowheaders = "1" */start_at='C3' sheet_interval='none' sheet_name='C5');
proc format;
    value gapf .,low-high=' ';
run;
proc report data=sashelp.class;
column age height gap weight;
define age / group; 
define height / mean; 
define weight / mean; 
define gap / ' ' style(column)={BORDERTOPCOLOR=white BORDERBOTTOMCOLOR=white background=white } ;
define gap/'' format=gapf. style(header)={background=white BORDERBOTTOMCOLOR=white BORDERTOPCOLOR=white};
rbreak before / summarize; run;

 

sas-innovate-white.png

Our biggest data and AI event of the year.

Don’t miss the livestream kicking off May 7. It’s free. It’s easy. And it’s the best seat in the house.

Join us virtually with our complimentary SAS Innovate Digital Pass. Watch live or on-demand in multiple languages, with translations available to help you get the most out of every session.

 

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

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