BookmarkSubscribeRSS Feed
deleted_user
Not applicable
I routinely need to generate pdf files containing program, log and output results. I am wondering if someone has had the code to automate it. If pdf is not an easy one, can a single file be generated in other formats?

Thanks.
2 REPLIES 2
sbb
Lapis Lazuli | Level 10 sbb
Lapis Lazuli | Level 10
Interactive SAS sessions? Batch? Daily production runs on an unattended server-class machine, or SAS adhoc queries/sessions? What OS is SAS running-on? Is SAS running locally or on a server? Have you looked at using ALTLOG and ALTPRINT SAS system options to create a copy of your process output?

You could always batch-process the results of a SAS session, writing the results to a "concatenated" PDF-format file, using SAS ODS. Or possibly you may find a suitable solution with a "PDF maker" utility function, operating in conjunction with the SAS system on a machine/workstation.

Scott Barry
SBBWorks, Inc.
Cynthia_sas
Diamond | Level 26
Hi:
As Scott says, there are a lot of unknowns in your question. Have you searched for previous forum postings? I know that this question has come up before and I have posted code several times. The topic titles were something like:
"Adding syntax at the end of ODS output"
and
"SAS log in ODS format" or "SAS log in RTF format" (or HTML or PDF)

A search on these topics should help you figure out whether a SAS approach or a 3rd party or Adobe approach is the way to go. In these previously posted programs, the end result would have been 2 separate PDF files -- one PDF file with the report output and one, separate, PDF file with the program/log output.

Generally, the issue with the "all-in-one" file approach -- where you have the report, the program (.SAS) file -and- the log (.LOG or .TXT) file all together is that although you can use ODS PDF to create the report output, you normally need to use "post-processing" techniques to get the .SAS file and the .LOG file into another, separate, PDF.

There are no SAS techniques to allow you to combine already-created PDF files, so unless you use ODS DOCUMENT to capture your report output objects and the .SAS file and the .LOG file into a DOCUMENT store, you are probably looking at the 3rd party PDF creation route.

cynthia

hackathon24-white-horiz.png

2025 SAS Hackathon: There is still time!

Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!

Register Now

How to Concatenate Values

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 2 replies
  • 1532 views
  • 0 likes
  • 3 in conversation