The SAS Output Delivery System and reporting techniques

margins in ods pdf file do not match margins specified in output style

Reply
Contributor
Posts: 28

margins in ods pdf file do not match margins specified in output style

Hi,

 

In order to have complete documentation of the analyses that I perform, I have SAS print the code and the log to pdf using proc document replay and ods pdf.

I used proc template to create a style called "Printouts" for these, and in that file I specify 1 inch margins.  It works perfect for the code, but when I open the pdf that contains the log, the left margin is about 2.5 inches instead of 1.

 

Why is the left margin of the log file not the 1.0 inch that is specified in the style?  Is there maybe another style element besides the margin that I need to modify?

 

Any input greatly appreciated!

 

See code below; results are exported to a folder in your C drive titled "SAS Printouts".

 

DM 'LOG;CLEAR;OUT;CLEAR;'; OPTIONS LS=128 PAGESIZE=36 NONUMBER;

FILENAME elog 'C:\SAS Printouts\99. LOG.log'; PROC PRINTTO log = elog; RUN;

 

*SAS code from each analysis will be placed here;

 

PROC TEMPLATE; DEFINE STYLE Styles.printouts; PARENT = STYLES.Journal;

style header from header/just=left; style data from data/just=left; style rowheader from header/just=left;

style body from document/ leftmargin=1.0in rightmargin=1.0in topmargin=1.0in bottommargin=1.0 in just=left;

style fonts from fonts/

'FixedFont' = ("Courier",6pt); END; RUN; quit;

PROC DOCUMENT NAME=CODE(WRITE);

IMPORT TEXTFILE = 'C:\SAS Printouts\Printout Test.SAS' TO^; RUN;

ODS PDF STYLE = printouts; OPTIONS ORIENTATION = PORTRAIT NODATE

leftmargin=1.0in rightmargin=1.0in topmargin=1.0in bottommargin=1.0 in;

ODS PDF FILE = 'C:\SAS Printouts\97 Code.pdf' NOTOC;

REPLAY; RUN; quit; ODS PDF CLOSE; QUIT;

PROC PRINTTO; RUN;

PROC DOCUMENT NAME = LOG(WRITE);

IMPORT TEXTFILE = 'C:\SAS Printouts\99. LOG.log' TO^; RUN;

ODS PDF STYLE = printouts; OPTIONS ORIENTATION = PORTRAIT NODATE

LEFTMARGIN = 1.0in RIGHTMARGIN = 1.0in TOPMARGIN = 1.0in BOTTOMMARGIN = 1.0IN;

ODS PDF FILE = 'C:\SAS Printouts\98. LOG.pdf' NOTOC;

REPLAY/ dest=(pdf); RUN; QUIT; ODS PDF CLOSE;

Esteemed Advisor
Esteemed Advisor
Posts: 6,692

Re: margins in ods pdf file do not match margins specified in output style

Why would you want to print code and log to pdf?  Are you not just creating a feedback loop, i.e. you print the code you are running out, but to do that you create code, so you should print that out as well, and then that needs printing out...

Doesn't make sense.  If you are using a version control system, which you should be under a validated programming environment, then you have full audit and change log.  The log can also be stored in that, and you would have some kind of logcheck program to pick up on errors.  At the end of the day, printing code and log out wouldn't prove anythinig to an auditor, you would need to link it to output files at the given time etc.

Grand Advisor
Posts: 9,701

Re: margins in ods pdf file do not match margins specified in output style

I think part of the reason is that Printto isn't intended to honor ODS but sent direct to printer or text file. From the online documentation:

Proc Printo statement Defines destinations, other than ODS destinations, for SAS procedure output and for the SAS Log.

(my emphasis added)

Post a Question
Discussion Stats
  • 2 replies
  • 329 views
  • 0 likes
  • 3 in conversation