SAS Office Analytics, SAS Add-In for Microsoft Office, and other integrations

Combine multiple PDFs into one in SAS

Posts: 1

Combine multiple PDFs into one in SAS

Is it possible to combine several PDF files into a single document in SAS? 

Here's our workflow:

1. Data in SAS

2. Graphic templates set up in Excel

3. Use DDE to create graphic products and output to PDF through Excel

Now, we need to combine all of those SAS-DDE-Excel produced PDFs into a single document using SAS.  I know it's possible to direct multiple products into a single PDF using ODS PDF FILE=, but we're creating PDFs through Excel, not SAS (and unfortunately can't change the workflow...).

Please advise.  Thanks.

Posts: 9,037

Re: Combine multiple PDFs into one in SAS


  I believe you have to use an Adobe product or a third-party PDF creation package to combine multiple PDF files (however they were created) into 1 PDF file. SAS cannot do it. Normally, you put multiple SAS outputs into 1 PDF file by doing something like this:

ods pdf file='makeone.pdf';

** proc print code;

** sas/graph code;

** some other proc code;

** Maybe some other sas/graph code;

ods pdf close;

In the above job, all 4 procedure outputs will go into 1 PDF file. You might try to replicate your Excel graphs using SAS/GRAPH or the SG procedures -- in which case, you could alter your process to do everything in SAS instead of SAS, DDE and Excel.

Otherwise, if you do not want to go down the SAS/GRAPH road, you may want to investigate third-party applications that can combine multiple PDFs into 1 PDF file or investigate Adobe products, such as Adobe Acrobat.


Occasional Contributor
Posts: 9

Re: Combine multiple PDFs into one in SAS

Hi, I am not using Adobe's products to create PDF files. I am using another PDF creation tool instead of Adobe to create multi pages PDFs. You can also google it and select a PDF processor whose way of processing is simple and fast to help you with the related work. It will be better if it is totally manual and can be customized by users according to our own favors. Remember to check its free trial package first if possible. I hope you success. Good luck.

Best regards,


Posts: 1

Re: Combine multiple PDFs into one in SAS

It is not currently possible to append to a PDF file that was created by ODS from within SAS®. However, this sample illustrates two methods that enable you to combine multiple tables in a PDF file using SAS. Hope it can help you combine multiple pdf files.

view more at:35375 - How to append to a PDF file created by ODS

Frequent Contributor
Posts: 98

Re: Combine multiple PDFs into one in SAS

I know its a old post but here is my solution:

You can use VBA macros to refresh data and then format it. #simple

Also it depends what kind of format you need. A lot can achieved via Proc Report.

Posts: 57

Re: Combine multiple PDFs into one in SAS

I'd recommend giving this article a read.  It should be able to do pretty much what you'd like to do with a few modifications:

Ask a Question
Discussion stats
  • 5 replies
  • 1 like
  • 6 in conversation