BookmarkSubscribeRSS Feed
Karlb
Calcite | Level 5

We have the need to produce a large pdf-report (Proc report) with variable left-border-margins prepared for physical book-printing. All odd pages should be produced with left border-margin 3cm, all even pages with margin 4cm.

Is this somehow possible? Any ideas, suggestions?

 

Thanks,

Karl

1 REPLY 1
pink_poodle
Barite | Level 11

Here is a similar post: Changing margins in PDF output

 

Its code can be modified for your purpose by replacing the values of PAGENO= and LEFTMARGIN= with macro variables and adding little macro "driver" programs that would instruct different treatment for odd and even pages [1].

 

%macro leftmargin(&PAGENO, &LMAR);
options orientation=landscape nodate pageno=&PAGENO leftmargin=&LMAR rightmargin=.25in; ods pdf file='c:\temp\carss.pdf'; proc report data=sashelp.cars(obs=30) nowd; title '1) take all defaults'; run;

%mend;

 

 /*
Following are the driver macros for odd
and even pages, respectively
*/

 

%macro lmar_odds; 
%DO i = 1 %TO lastpage %BY 2; %leftmargin( &i, 3cm ) %END;
%mend; %macro lmar_evens;
%DO i = 2 %TO lastpage %BY 2; %leftmargin( &i, 4cm ) %END;
%mend;

 

/* Calling the macros */

 

%lmar_odds
%lmar_evens

 

Reference

 

[1]   %DO, Iterative Statement

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

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
  • 1 reply
  • 931 views
  • 0 likes
  • 2 in conversation