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

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
1 ACCEPTED SOLUTION

Accepted Solutions
Reeza
Super User

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

 

View solution in original post

10 REPLIES 10
Reeza
Super User

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

ballardw
Super User

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

Ksharp
Super User
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;
Ksharp
Super User
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;
Ksharp
Super User
The forum keep eating my code. ods text=' < b r > < / b r > ' ;
PaigeMiller
Diamond | Level 26

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

--
Paige Miller
PaigeMiller
Diamond | Level 26

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
Reeza
Super User

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

 

PaigeMiller
Diamond | Level 26

@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
ballardw
Super User

@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.

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