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
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?
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.
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?
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;
Thanks Cynthia,
You helped me a lot!!
I really appreciate!
Daniel
@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.
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 25. Read more here about why you should contribute and what is in it for you!
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.