The SAS Output Delivery System and reporting techniques

ODS HTML -- Is it possible to control how much output appears on a page?

Accepted Solution Solved
Reply
Respected Advisor
Posts: 2,044
Accepted Solution

ODS HTML -- Is it possible to control how much output appears on a page?

I am using PROC REPORT to generate tables, and sending the output to an HTML file via ODS HTML. Everything works great, I get the exact tables that I want, except I want two tables on a page, and there are more than 2 BY groups. So, I want the first two BY groups on page 1, the next two BY groups on page 2, and so on and so forth. For completeness, here is my code (although I think the problem isn't this code, it's somewhere in ODS that I don't know). How can I do this?

 

ods html file="report.html" path="&myfolder" style=htmlblue;
proc report nowindows data=stats1; by fico; column ias ltv,ever60pct ltv,bankinterestrate ltv,nloans; define ias/group 'IAS' order=data; define ltv/across "LTV" order=internal; define ever60pct/analysis sum format=nlpctn12.2 'Ever 60 %'; define nloans/analysis sum format=comma6.0 'N Loans'; define bankinterestrate/analysis sum format=6.2 'Interest Rate'; run;
ods html close;
--
Paige Miller

Accepted Solutions
Solution
‎08-21-2017 11:07 AM
Super User
Posts: 20,688

Re: ODS HTML -- Is it possible to control how much output appears on a page?

Posted in reply to PaigeMiller

PDF or RTF and use STARTPAGE option to control page breaks?

 

View solution in original post


All Replies
Super User
Posts: 20,688

Re: ODS HTML -- Is it possible to control how much output appears on a page?

Posted in reply to PaigeMiller

HTML doesn't have a concept of pages - that's likely the biggest issue. 

Super User
Posts: 11,765

Re: ODS HTML -- Is it possible to control how much output appears on a page?

Posted in reply to PaigeMiller

Can you provide some example data. I'm not going to try to fudge something up with that many variables.

Super User
Posts: 10,194

Re: ODS HTML -- Is it possible to control how much output appears on a page?

Posted in reply to PaigeMiller
How about this one ?




ods html options(page_break='no');
proc report data=sashelp.class(where=(sex='F')) nowd;
run;
ods text='
'; proc report data=sashelp.class(where=(sex='M')) nowd; run; ods text='
'; proc report data=sashelp.class nowd; run; ods html close;
Super User
Posts: 10,194

Re: ODS HTML -- Is it possible to control how much output appears on a page?

Posted in reply to PaigeMiller
ods html options(page_break='no'); proc report data=sashelp.class(where=(sex='F')) nowd; run; ods text='
'; proc report data=sashelp.class(where=(sex='M')) nowd; run; ods text='
'; proc report data=sashelp.class nowd; run; ods html close;
Super User
Posts: 10,194

Re: ODS HTML -- Is it possible to control how much output appears on a page?

The forum keep eating my code. ods text=' < b r > < / b r > ' ;
Respected Advisor
Posts: 2,044

Re: ODS HTML -- Is it possible to control how much output appears on a page?

Thanks, @Ksharp. I will give this a try on Monday.

--
Paige Miller
Respected Advisor
Posts: 2,044

Re: ODS HTML -- Is it possible to control how much output appears on a page?

Posted in reply to PaigeMiller

This raises the question, if ODS HTML is not a good choice here (as pointed out by @Reeza), what would be a better ODS destination where I can force a new page after two by groups, and another new page after another two by groups, and so on?

--
Paige Miller
Solution
‎08-21-2017 11:07 AM
Super User
Posts: 20,688

Re: ODS HTML -- Is it possible to control how much output appears on a page?

Posted in reply to PaigeMiller

PDF or RTF and use STARTPAGE option to control page breaks?

 

Respected Advisor
Posts: 2,044

Re: ODS HTML -- Is it possible to control how much output appears on a page?

[ Edited ]

Reeza wrote:

PDF or RTF and use STARTPAGE option to control page breaks?

 


I will certainly give this a try on Monday when I am back in the office. It appears that I am going to have to write some sort of macro loop to output two by-groups at a time to a single page (which, by the way, is not the problem, I can write macro loops in my sleep). Do you agree? Or am I missing something here?

--
Paige Miller
Super User
Posts: 11,765

Re: ODS HTML -- Is it possible to control how much output appears on a page?

Posted in reply to PaigeMiller

PaigeMiller wrote:

Reeza wrote:

PDF or RTF and use STARTPAGE option to control page breaks?

 


I will certainly give this a try on Monday when I am back in the office. It appears that I am going to have to write some sort of macro loop to output two by-groups at a time to a single page (which, by the way, is not the problem, I can write macro loops in my sleep). Do you agree? Or am I missing something here?


Proc Report does have a role for a variable to do "page" so if an additional variable to indicate the page as the first column and set to noprint might work.

☑ This topic is solved.

Need further help from the community? Please ask a new question.

Discussion stats
  • 10 replies
  • 456 views
  • 0 likes
  • 4 in conversation