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

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
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
  • 839 views
  • 0 likes
  • 2 in conversation