BookmarkSubscribeRSS Feed
yashpande
Obsidian | Level 7

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

Look at different widthLook at different width

2 REPLIES 2
Cynthia_sas
SAS Super FREQ

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;
PGStats
Opal | Level 21

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

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
  • 2068 views
  • 1 like
  • 3 in conversation