BookmarkSubscribeRSS Feed
deleted_user
Not applicable
Hi

I want to know how could we stack two reports produced using proc report into one table. In other words, I have two child reports generated separately by two proc reports. I want to stack them end to end such that the top of the second report is attached to the bottom of the first one.
6 REPLIES 6
sbb
Lapis Lazuli | Level 10 sbb
Lapis Lazuli | Level 10
Research your ODS HTML facility options, however I don't know of a method to directly "fuse" two PROC outputs together with "ODS HTML", assuming you do not want the HTML TABLE body content to be separate (no titles or BY separation). Programming ODS HTML to generate back-to-back PROC outputs is definitely possible, within the same HTML document, using various techniques, such as BY group processing, or iterative invocation with WHERE processing.

For consideration, I find that the SAS support website at http://support.sas.com/ provides many examples and also you can search for topic-oriented references, using relative keywords and phrases. I have provided links to some related SUGI/SGF papers.

Scott Barry
SBBWorks, Inc.
__________________

ODS HTML papers:

http://www2.sas.com/proceedings/sugi29/245-29.pdf

http://www2.sas.com/proceedings/sugi27/p008-27.pdf


SAS Base technical resources home:

http://support.sas.com/rnd/base/
deleted_user
Not applicable
Thanks. But that is not I want. Look into this document below. I want to achieve this in HTML.

http://www2.sas.com/proceedings/sugi31/089-31.pdf
Cynthia_sas
SAS Super FREQ
Hi:
The paper that you showed did illustrate one way to "stack" tables together. He did it with a custom SAS macro program. You could contact the author of that paper to see whether he will share his macro program with you.

Most of the methods I know involve either creating the 2 tables/reports separately (as SAS data sets) and then concatenating them together and having 1 report job or using DATA _NULL_ -- with a custom table template -- to write out both reports. In the "old" days, people used to use DATA _NULL_ to the LISTING destination (Output Window) for this kind of report.

For example, in this paper, I showed taking the results from PROC FREQ and from PROC MEANS and concatenating the tables together and then using PROC REPORT.
Creating Complex Reports: http://www2.sas.com/proceedings/forum2008/173-2008.pdf
Zip file of programs for paper: http://support.sas.com/rnd/papers/sgf2008/complex_reports.zip

cynthia
Duong
Obsidian | Level 7
Hi brkiranphm

I know you ask for HTML but since you refer to the RTF paper - if I may also refer you
to the paper(%RiTEN) http://www.phuse.eu/download.aspx?type=cms&docID=221

To stack RTF tables it is very simple to do with post-processing as discussed in the paper. I also discussed another level of flexibility - that is Cell Merging. You can then open the RTF file and save in HTML format.

Having said that - If you can post-process RTF file then you can post-process HTML file. I have not experiment in HTML so do not know dificult this is.


Regards
Duong
www.tranz.co.uk
Duong
Obsidian | Level 7
Hi brkiranphm

If you run the prog below then open the test.html then delete the 2 lines
indicated and you will see your tables stacked. I have ran this in PC SAS v9.1.3
Once the 2 lines deleted open in IE6 works but FireFox v2 did not seem to work properly.

:



<------ delete this




<------ delete this



:
:


/* test.sas */
ODS HTML FILE='c:\test.html';

proc report data = sashelp.class missing nowindows
style(report) = [just=center outputwidth=60%]
;
column name sex age height weight;
run;

title;

proc report data = sashelp.class missing nowindows noheader
style(report) = [just=center outputwidth=60%]
;
column name sex;
run;

ODS HTML CLOSE;



Regards
Duong
www.tranz.co.uk
Duong
Obsidian | Level 7
Sorry

The previous post did not display clearly. In meant to say delete these two lines in the test.html.

br <---- delete this
page-break-afer: always etc <---- delete this line and the br few lines above this


Regards
Duong
www.tranz.co.uk

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

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