BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
Moraes86
Obsidian | Level 7

Hi guys, 

 

I have 3 different tables and I would like to include them in one final report.

I thought proc report would be one option.

 

Is it possible or is there another one?

 

Thanks in advance,

 

Daniel

1 ACCEPTED SOLUTION

Accepted Solutions
Moraes86
Obsidian | Level 7

I mean that I created 3 tables using the SAS codes.

For example, I created tab A, tab B and tab C using SAS. 

 

I was wondering how command I should create to put all of these three in my final report.

 

Could I explain better?

 

View solution in original post

5 REPLIES 5
ballardw
Super User

It may help to show the code you are using for the reports.

 

What exactly do you mean by "include 3 tables"? If you mean three tables in a single document that's easy with ODS. All the output generated between an ODS destination statement and the corresponding ODS destination close goes to the same document.

 

If you mean a single procedure call that gets into the "maybe" category as it depends on the actual content of your data and desired report appearance. BY group for example creates one element of a report for each level of a variable.

 

Proc Tabulate can create multiple tables of different structure from a single data set.

 

Details matter when choosing and approach or procedure.

Moraes86
Obsidian | Level 7

I mean that I created 3 tables using the SAS codes.

For example, I created tab A, tab B and tab C using SAS. 

 

I was wondering how command I should create to put all of these three in my final report.

 

Could I explain better?

 

Cynthia_sas
SAS Super FREQ

Hi:

  Try this code out for yourself. As long as all your procedure steps are inside a single ODS "sandwich" -- the ODS open and close statements-- all of your PROC REPORTS should be contained within one result file. The name of the result file will be the FILE= option that you use.

Cynthia

 

Try this:

options nodate number orientation=portrait;

ods html path='c:\temp' file='all3.html';
ods rtf file='c:\temp\all3.rtf';
ods pdf file='c:\temp\all3.pdf';
 
proc report data=sashelp.class;
title 'A';
run;
 
proc report data=sashelp.shoes(obs=25);
title 'B';
run;
 
proc report data=sashelp.prdsale(obs=25);
title 'C';
run;
 
ods html close;
ods rtf close;
ods pdf close;
Moraes86
Obsidian | Level 7

Thanks Cynthia,

You helped me a lot!!

 

I really appreciate!

 

Daniel

ballardw
Super User

@Moraes86 wrote:

I mean that I created 3 tables using the SAS codes.

For example, I created tab A, tab B and tab C using SAS. 

 

I was wondering how command I should create to put all of these three in my final report.

 

Could I explain better?

 


"Created Tab A, Tab B and Tab C" almost certainly means that you were creating spreadsheet output of some flavor, either ODS EXCEL or TAGSETS.EXCELXP.

Which means that you would want to use the SHEET_INTERVAL option to place all the results on a single "Tab".

 

Something like

ods excel file="myfile.xlsx"
   options(sheet_interval='NONE');

<output code for tab a>
<output code for tab b>
<output code for tab c>

ods excel close;

Which is why we ask for code. If you had shown an ODS Excel, or Tagsets.excelxp, statement it would have been pretty obvious what you wanted.

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
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
  • 5 replies
  • 655 views
  • 0 likes
  • 3 in conversation