The SAS Output Delivery System and reporting techniques

Using ODS to print log?

Reply
Contributor
Posts: 29

Using ODS to print log?

Proc printto had a nice capability of printing both the log window and procedure results to a single file. Is there a similar option available for ODS (specifically ODS PDF)?

Thank you.
SAS Employee
Posts: 174

Re: Using ODS to print log?

There's an undocumented capability in 9.2 PROC DOCUMENT to import a text file. You could create an ODS document for the procedure results, import the SAS log file into the document, and then replay the ODS document to the ODS PDF destination. Example:
[pre]
ods listing close;
ods document name=temp(write);
proc printto log="SAS.LOG";
run;
proc tabulate data=sashelp.class;
class sex age;
table sex,age;
run;
proc printto;
run;
ods document close;
proc document name=temp;
import textfile="SAS.LOG" to ^;
ods pdf file="out.pdf" notoc;
replay;
run;
quit;
ods pdf close;
ods listing;
[/pre]

-- David Kelley, SAS
Regular Contributor
Posts: 170

Re: Using ODS to print log?

Ask a Question
Discussion stats
  • 2 replies
  • 354 views
  • 0 likes
  • 3 in conversation