BookmarkSubscribeRSS Feed
deleted_user
Not applicable
I need to routinely generate a pdf file containing the program, log file, and output results. I am currently copy and past all of those in word and generate a pdf there. This is boring and tiring. I am wondering is someone has already had the code to automate it?

Thanks.
3 REPLIES 3
sbb
Lapis Lazuli | Level 10 sbb
Lapis Lazuli | Level 10
Suggestion: consolidate your post here - usually not necessary to post in multiple forums, as most subscribers and other audience read them all.

http://support.sas.com/forums/thread.jspa?threadID=11060&tstart=0

Scott Barry
SBBWorks, Inc.
Cynthia_sas
SAS Super FREQ
Hi:
PDF format is a proprietary format -- meant to be opened with Adobe Acrobat Reader and meant to be created from either an Adobe product or a software application like SAS (ODS PDF).

ODS PDF will easily take your REPORT output or outputs (what would normally go to the LISTING window) and put it into a PDF file. However, due to the nature of PDF files, you cannot use SAS to combine 2 PDF files together. So, if you have REPORT1.PDF and REPORT2.PDF, you could not use SAS to combine them into 1 new PDF. That's because Adobe has file start and file end control commands in each file that make their combining with SAS virtually impossible to do.

However, with an Adobe product, you could combine REPORT1.PDF and REPORT2.PDF together.

The SAS program (.SAS) and the SAS log file (.LOG) (when saved to an external file) are just ASCII text files. There is no direct way to convert a program file or a log file to PDF format. However, you CAN read a .SAS or .LOG file into a SAS dataset and then, once in dataset format, you can write the file back out to ODS PDF form. The reason I mentioned about REPORT1.PDF and REPORT2.PDF up above, however, is the relevant point here. You would need for your program to be "finished" before you could grab your .LOG file -- so that means the while it is theoretically possible to have the report and .SAS file in one PDF file, your .LOG file would be in a second PDF file and you could not combine the two PDF files together with SAS -- you'd have to use either an Adobe product or a 3rd party product to combine the files together. So, if you were going to use an Adobe product or a 3rd party product, you might as well just create your report with ODS PDF and then use the 3rd party product to create 1 file of the .LOG and .SAS files along with the report PDF.

There have been several previous forum postings about printing the log to either RTF or PDF (or HTML) and/or printing the program to PDF. A search with the forum search facility should help you find those previous posts.

cynthia
Dreamer
Obsidian | Level 7

I don't think there is any direct way because sas generates a ascii file.

But once its there you can combine them using ODS PDF --> Data step to import those log files --> Proc print to a pdf file!!

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 3 replies
  • 912 views
  • 0 likes
  • 4 in conversation