Data visualization with SAS programming

Can you change columns/panels within an ODS rtf?

Accepted Solution Solved
Reply
Contributor
Posts: 45
Accepted Solution

Can you change columns/panels within an ODS rtf?


I have very lengthy document outputs that I am using with ODS graphics and am trying to find a way to shorten them.  The problem is with my data tables.  I have a list of macros that read data from excel, create charts based on the test names that I put into the macros, and provide the respective data after the charts.  The issue is that I will have for some documents 64 pages of charts, but 300 or more pages of the data.  The layout of the document is Charts Test 1, Data Test 1, Charts Test 2, Data Test 2, ect...  The data output in the rtf file though is creating a data table that runs as one column right down the center of the page.  For some charts, this data table can run 15 pages or so, where if I could get the data to run across the page before moving to the next, it would cut out 12 pages or more for a particular test.  And that adds up when I have 15+ tests for one document.  If I use the columns= option in the ods statment, it will also fit multiple graphs onto a single page, which I don't want.  But that makes my data fill up the page to utilize page space.  I have tried changing from proc print to proc report and use the panels=99 option, but when running ODS it ignore the panels option and continues to print my data right down the center of a page on many pages.


Accepted Solutions
Solution
‎07-23-2014 05:28 PM
SAS Super FREQ
Posts: 8,721

Re: Can you change columns/panels within an ODS rtf?

Hi:

This worked for me to get 1 column for the picture/graph and then different columns for the PROC PRINT. You are correct that the PANELS= option in PROC REPORT is ignored by ODS destinations (it is a LISTING only option).

Cynthia

ods rtf file='c:\temp\change_cols.rtf';

ods rtf columns=1;

proc sgplot data=sashelp.cars;

  where type = 'Sedan' and mpg_city ge 25;

  title 'Sedan VBAR';

  vbar make / response=mpg_city stat=mean;

run;

 

ods rtf columns=3;

proc print data=sashelp.cars;

title 'Sedan';

where type = 'Sedan';

var make mpg_city;

run;

  

ods rtf columns=1;

proc sgplot data=sashelp.cars;

  where type = 'SUV'  and mpg_city ge 20;

  title 'SUV VBAR';

  vbar make / response=mpg_city stat=mean;

run;

 

ods rtf columns=2;

proc print data=sashelp.cars;

title 'SUV';

where type = 'SUV';

var make mpg_city;

run;

ods rtf close;

View solution in original post


All Replies
Solution
‎07-23-2014 05:28 PM
SAS Super FREQ
Posts: 8,721

Re: Can you change columns/panels within an ODS rtf?

Hi:

This worked for me to get 1 column for the picture/graph and then different columns for the PROC PRINT. You are correct that the PANELS= option in PROC REPORT is ignored by ODS destinations (it is a LISTING only option).

Cynthia

ods rtf file='c:\temp\change_cols.rtf';

ods rtf columns=1;

proc sgplot data=sashelp.cars;

  where type = 'Sedan' and mpg_city ge 25;

  title 'Sedan VBAR';

  vbar make / response=mpg_city stat=mean;

run;

 

ods rtf columns=3;

proc print data=sashelp.cars;

title 'Sedan';

where type = 'Sedan';

var make mpg_city;

run;

  

ods rtf columns=1;

proc sgplot data=sashelp.cars;

  where type = 'SUV'  and mpg_city ge 20;

  title 'SUV VBAR';

  vbar make / response=mpg_city stat=mean;

run;

 

ods rtf columns=2;

proc print data=sashelp.cars;

title 'SUV';

where type = 'SUV';

var make mpg_city;

run;

ods rtf close;

Contributor
Posts: 45

Re: Can you change columns/panels within an ODS rtf?

Thank  you very much Cynthia.  That was a very simple and very helpful solution.  Now some of our 300+ page SAS output can be condensed to less than half.

☑ This topic is SOLVED.

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

Discussion stats
  • 2 replies
  • 440 views
  • 0 likes
  • 2 in conversation