The SAS Output Delivery System and reporting techniques

Printing contents of the Output window

Reply
Occasional Contributor
Posts: 7

Printing contents of the Output window

Folks, 

I often am required to print to pdf the contents of the output window. I would like to do this programatically, but can't find any means to do so. I am familiar with outputing the contents to *.lst files, and I am familiar with ODS pdf output, but neither work in this case as I am required to maintain the style of the output window, and ods adds formatting, and the *.lst file has to be opened in sas. Is there a way to remove the formatting that comes with ods pdf by default so that it matches the output window?  

Super User
Super User
Posts: 5,970

Re: Printing contents of the Output window

To print the output WINDOW to PDF just use any one of the tools that allow you to print to a PDF file instead of an actual printer.

To convert the .lst file then use a tool that converts a text file to a PDF file.  You could possible do both with the same tool.

Occasional Contributor
Posts: 7

Re: Printing contents of the Output window

I have access to all adobe products, and can print the output window to pdf manually, but is there a way to do that programatically? I think I am missing something here. Thank you for your quick reply!

Super User
Super User
Posts: 5,970

Re: Printing contents of the Output window

If you are using Display Manager then you can use the DM command to issue commands. I am sure there is one to print and there are ways to set the default destination for the printer.

 

What we used to do was issue the display manager command to print the output (or log) window to a file and then save and or send that file where we wanted.  It was better to use the PRINT FILE= command instead of the FILE command because then the form feeds between pages where included.

 

What we used to do for a text file was run it through a publicly available text to postscript toool (GhostWriter perhaps?) and then run it through Adobe's distiller program to generate a PDF file from the postscript file.

 

Super User
Super User
Posts: 5,970

Re: Printing contents of the Output window

Many years ago I also adapted a publicly available SAS program that wrote PDF file format directly.  I see that Scott Bass has a version of it on line.

https://github.com/scottbass/SAS/blob/master/Macro/txt2pdf.sas

Grand Advisor
Posts: 16,316

Re: Printing contents of the Output window

When using ODS PDF you can modify the STYLE.

 

I don't know if there's a style that mimics the LST output identically but you can strip a lot of the formatting from it.

Monospace seems similar to LST?

http://support.sas.com/documentation/cdl/en/odsug/67921/HTML/default/viewer.htm#p14qidvs5xf7omn14omm...

 

If you're really motivated you can probably customize one to what you want. 

 

ODS PDF file='sample.pdf' style=minimal;


*sas code;



ODS PDF close;
Super Contributor
Posts: 394

Re: Printing contents of the Output window

Well, you can't "remove" the formatting but you can change it. When you say "the output window" are you talking about the old monospace output window or the new (SAS 9.3) HTML output? If the old, then you might try using the Monospace style on your PDF output. If the new HTML output, then use the HTMLBlue style.

Occasional Contributor
Posts: 7

Re: Printing contents of the Output window

Thank you very much for all of your replies, it seems I have some reading to do! 

Tom, that utility is really neat, thanks for that!

 

Post a Question
Discussion Stats
  • 7 replies
  • 285 views
  • 2 likes
  • 4 in conversation