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


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.

1 ACCEPTED SOLUTION

Accepted Solutions
Cynthia_sas
SAS Super FREQ

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

2 REPLIES 2
Cynthia_sas
SAS Super FREQ

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;

Jolly
Calcite | Level 5

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.

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

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
  • 2 replies
  • 1466 views
  • 0 likes
  • 2 in conversation