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
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
It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.
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.
Ready to level-up your skills? Choose your own adventure.