Is it possible to include submitted syntax or even output of log file when ODS into a PDF using SAS?
For instance, give this simple code:
ods pdf file = "c:\temp\myPDF.pdf";
proc reg data = mydata;
model y = x;
run;
ods pdf close;
I can get the regression output and accompanying graph fine. But is it possible to incorporate into PDF the enclosed command like this?
proc reg data = mydata;
model y = x;
run;
It is, but it requires a couple of hoops. Luckily, you could wrap this into macros to clean up your code.
fileref
to hold your log.ODF TEXT=
Hope this helps
filename x temp;
ods pdf file="c:\temp\temp.pdf";
title "Cost of Power";
options source;
proc printto log=x;
run;
proc reg data=sashelp.cars;
model msrp = horsepower;
run;
quit;
proc printto;run;
title;
ods pdf startpage=now; /*Force a new page in the PDF*/
data _null_;
infile x;
input;
call execute("ods text='LOG: "||_infile_||"';");
run;
ods pdf close;
filename x ;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With