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

I want to change the left and right margins in the pdf files I am outputting.  Actually, the real problem is that each obs requires more than one line, so I thought I would start with the orientation and margin width.  I would welcome suggestions for any other options that would allow me to output one record per line.

partial code:

%macro elemREP (num=);

ods pdf body="G:\Departments\Research\Misc\EVAAS\1415\School Rosters\&num._Verify_Roster_EVAAS.pdf";

options orientation=landscape nodate pageno=1 leftmargin=.1 rightmargin=.1;

proc print data=joinelem4 noobs

1 ACCEPTED SOLUTION

Accepted Solutions
Cynthia_sas
SAS Super FREQ

HI:

  I have a few suggestions. One is to flip your statements and list the margin options BEFORE the ODS PDF statement. This will ensure that ODS will get the NEW options when it starts up. The other option is to specify an exact unit of measure with ODS PDF -- otherwise, you are forcing PDF to translate from the default unit of measure.

options orientation=landscape nodate pageno=1 leftmargin=.1 rightmargin=.1;

ods pdf body="G:\Departments\Research\Misc\EVAAS\1415\School Rosters\&num._Verify_Roster_EVAAS.pdf";

  For example, consider the difference in output length and width for just 30 obs in SASHELP.CARS.

cynthia

options orientation=landscape nodate pageno=1 leftmargin=.25in rightmargin=.25in;

ods pdf file='c:\temp\carss.pdf';

proc report data=sashelp.cars(obs=30) nowd;

title '1) take all defaults';

run;

proc report data=sashelp.cars(obs=30) nowd

  style(report)={cellpadding=2px font_size=8pt}

  style(header)={font_size=9pt}

  style(column)={font_size=8pt};

title '2) change some style options';

run;

ods pdf close;

View solution in original post

3 REPLIES 3
Reeza
Super User

I think you'll need to post some sample data for more help.

Other methods include modifying the template to reduce cell size and padding.

Here's a link to a common style I've used (borrowed from a former colleague). You can modify the cell spacing, padding and font size as needed.

Hope it's helpful.

SAS - RTF Style for tables

Cynthia_sas
SAS Super FREQ

HI:

  I have a few suggestions. One is to flip your statements and list the margin options BEFORE the ODS PDF statement. This will ensure that ODS will get the NEW options when it starts up. The other option is to specify an exact unit of measure with ODS PDF -- otherwise, you are forcing PDF to translate from the default unit of measure.

options orientation=landscape nodate pageno=1 leftmargin=.1 rightmargin=.1;

ods pdf body="G:\Departments\Research\Misc\EVAAS\1415\School Rosters\&num._Verify_Roster_EVAAS.pdf";

  For example, consider the difference in output length and width for just 30 obs in SASHELP.CARS.

cynthia

options orientation=landscape nodate pageno=1 leftmargin=.25in rightmargin=.25in;

ods pdf file='c:\temp\carss.pdf';

proc report data=sashelp.cars(obs=30) nowd;

title '1) take all defaults';

run;

proc report data=sashelp.cars(obs=30) nowd

  style(report)={cellpadding=2px font_size=8pt}

  style(header)={font_size=9pt}

  style(column)={font_size=8pt};

title '2) change some style options';

run;

ods pdf close;

GreggB
Pyrite | Level 9

Thanks for your help.

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
  • 3 replies
  • 9978 views
  • 0 likes
  • 3 in conversation