The SAS Output Delivery System and reporting techniques

How to make table size same for different procedures in ODS PDF

Reply
Contributor
Posts: 52

How to make table size same for different procedures in ODS PDF

Hi All,

I have different procedures in my ODS PDF. Its PDF with 5 pages and several procedures like proc report, proc print, proc tabulate and proc univariate. When we see output, it looks really scattered. Below is code.

 


data cars;
set sashelp.cars (obs=10);
run;
options papersize=(21in 15in) leftmargin=1.05in rightmargin=1.05in;
ods escapechar = '~'
noresults
noproctitle ;

options symbolgen;

ODS LISTING CLOSE;
ods _all_ close;
ods pdf file="/sasdata/Shared/test.pdf" gtitle gfootnote;
ods pdf startpage=now;
proc report data=cars;
run;

ods pdf startpage=no;
proc print data=cars;
run;
ods pdf close;

 

Problem is the width of these 2 results in pdf differs.  While I do understand that these are 2 different procedures and would differ in  appearance when executed . still Is there a way we can make it aligned  at least in terms of width? see the screen below

Any help is really appreciated

Capture.JPGLook at different width

SAS Super FREQ
Posts: 9,253

Re: How to make table size same for different procedures in ODS PDF

[ Edited ]
Posted in reply to yashpande

Hi:
For PRINT, REPORT and TABULATE, you can make width=100% or width=8in as a style= override. But you can only change that in UNIVARIATE with a TABLE template change. Since you did not post any UNIVARIATE code, I used SASHELP.CARS, and SASHELP.HEART for this example, below.
cynthia

 

options papersize=(21in 15in) leftmargin=1.05in rightmargin=1.05in;
ods escapechar = '~';
ods noproctitle ;

ods _all_ close;
ods pdf file="c:\temp\test.pdf" uniform;
ods pdf startpage=now;
proc report data=sashelp.cars(obs=10)
     style(report)={width=18in};
run;

ods pdf startpage=no;
proc print data=sashelp.heart(obs=10) noobs
     style(table)={width=18in};
run;

proc tabulate data=sashelp.cars;
  class make origin;
  var msrp mpg_city mpg_highway cylinders;
  table origin,
        msrp*(mean max) mpg_city*(mean max) mpg_highway*(mean max)
		cylinders*(mean max)
     /style={width=18in};
run;
ods pdf close;
Esteemed Advisor
Posts: 5,391

Re: How to make table size same for different procedures in ODS PDF

Posted in reply to yashpande

I got them to align by adding style=, noobs, and label options

 

data cars;
set sashelp.cars (obs=10);
run;
options papersize=(21in 15in) leftmargin=1.05in rightmargin=1.05in;
ods escapechar = '~' 
 noresults 
 noproctitle ;

ODS LISTING CLOSE;
ods _all_ close;
ods pdf file="&sasforum.\reports\test.pdf" gtitle gfootnote;
ods pdf startpage=now;
proc report data=cars style(report)={outputwidth=17in};
run;

ods pdf startpage=no;
proc print data=cars noobs label style(table)={outputwidth=17in};
run;
ods pdf close;
PG
Ask a Question
Discussion stats
  • 2 replies
  • 238 views
  • 1 like
  • 3 in conversation