Help using Base SAS procedures

ODS - Need bar chart and proc report results on same page.

Accepted Solution Solved
Reply
Contributor
Posts: 31
Accepted Solution

ODS - Need bar chart and proc report results on same page.

Can a bar chart and results from a Proc Report be placed on the same page?

I need to create a couple hundred barcharts with their corresponding data in a spreadsheet format directly below and on the same page.  Since I have hundreds of these to create, I don't want to export the results to excel and make a couple hundred worksheets.  Can two data elements, like a bar chart and results from proc report or proc tabulate be shown on the same page?  Is there a way to control the page breaks?

Thanks! Linda


Accepted Solutions
Solution
‎04-09-2012 01:40 PM
SAS Super FREQ
Posts: 8,743

Re: ODS - Need bar chart and proc report results on same page.

Hi:

  ODS RTF and ODS PDF both support the STARTPAGE= option. Depending on your version of SAS, you can try STARTPAGE=NO -- in 9.3, that should work for both PDF and RTF. In earlier versions of SAS, you might have had to use STARTPAGE=NEVER for PDF. But the code below should work for you in 9.3 of SAS.

cynthia

ods listing close;

options nodate nonumber;

ods graphics / reset=all;

   

ods pdf file='c:\temp\twothings.pdf' startpage=no style=egdefault;

ods rtf file='c:\temp\twothings.rtf' startpage=no style=egdefault;

ods html path='c:\temp' (url=none)

         file="twothings.html"

    options(pagebreak='no') style=egdefault;

   

title 'Proc TABULATE';

proc tabulate data=sashelp.class;

  class age sex;

  var height;

  table sex all,

        age='Height Statistics by Age'*height=' '*(n mean);

run;

title;

   

proc sgplot data=sashelp.class;

  vbar age /group=sex groupdisplay=cluster;

  xaxis type=discrete;

run;

  

ods _all_ close;

View solution in original post


All Replies
Contributor
Posts: 31

Re: ODS - Need bar chart and proc report results on same page.

I found where I control it in HTML, but I need to supress page breaks in output to rtf or pdf  Here's the html code to supress page breaks:

 

ods html file="test.html" options(pagebreak='no');

Solution
‎04-09-2012 01:40 PM
SAS Super FREQ
Posts: 8,743

Re: ODS - Need bar chart and proc report results on same page.

Hi:

  ODS RTF and ODS PDF both support the STARTPAGE= option. Depending on your version of SAS, you can try STARTPAGE=NO -- in 9.3, that should work for both PDF and RTF. In earlier versions of SAS, you might have had to use STARTPAGE=NEVER for PDF. But the code below should work for you in 9.3 of SAS.

cynthia

ods listing close;

options nodate nonumber;

ods graphics / reset=all;

   

ods pdf file='c:\temp\twothings.pdf' startpage=no style=egdefault;

ods rtf file='c:\temp\twothings.rtf' startpage=no style=egdefault;

ods html path='c:\temp' (url=none)

         file="twothings.html"

    options(pagebreak='no') style=egdefault;

   

title 'Proc TABULATE';

proc tabulate data=sashelp.class;

  class age sex;

  var height;

  table sex all,

        age='Height Statistics by Age'*height=' '*(n mean);

run;

title;

   

proc sgplot data=sashelp.class;

  vbar age /group=sex groupdisplay=cluster;

  xaxis type=discrete;

run;

  

ods _all_ close;

Contributor
Posts: 31

Re: ODS - Need bar chart and proc report results on same page.

AWESOME!!!   I will give this a try right away!  I have version 9.2 still.  Smiley Happy

☑ This topic is SOLVED.

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

Discussion stats
  • 3 replies
  • 397 views
  • 3 likes
  • 2 in conversation