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

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

1 ACCEPTED SOLUTION

Accepted Solutions
Cynthia_sas
SAS Super FREQ

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

3 REPLIES 3
LindaH1120
Fluorite | Level 6

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');

Cynthia_sas
SAS Super FREQ

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;

LindaH1120
Fluorite | Level 6

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

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

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