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?
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.
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"
"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.