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
Diamond | Level 26

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
Diamond | Level 26

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

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

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
  • 2017 views
  • 3 likes
  • 2 in conversation