Hi all,
I want to output different data to different pdf files without having to do the same step multiple times.
the data in proc report.
Please see the answer to this question: https://communities.sas.com/t5/ODS-and-Base-Reporting/Producing-PDFs-per-by-Group/m-p/322352.
If that doesn't address your question, please expand your question with sample data, more information on what you are trying to do, and the code you have tried.
Please see the answer to this question: https://communities.sas.com/t5/ODS-and-Base-Reporting/Producing-PDFs-per-by-Group/m-p/322352.
If that doesn't address your question, please expand your question with sample data, more information on what you are trying to do, and the code you have tried.
Hi:
One suggestion that's been posted is to use BY group processing and the NEWFILE= option. Without more context for your question, it is hard to guess what you mean by different data to different PDF files without doing the same step multiple times. Does that mean something like you want some output to go to 2 PDF files, but other output to only go to one of the 2 PDF files?? It doesn't matter whether you are using PROC REPORT, PROC PRINT, PROC MEANS or PROC REG. Your ODS destination statements go above and below all the procedure code (I call it the "ODS Sandwich").
When a procedure creates output, it writes to ALL the open ODS destinations. Typically, you have only 1 destination open at a time. Sometimes, you have different destinations, like HTML, RTF and PDF all open at the same time. However, if you need to have multiple instances of the SAME destination open to receive output, then one thing you can do is to use the ID= suboption in order to control opening and closing the open destinations. Here's an example using ODS PDF. Notice that I can use either ID= with an identifier or I can just use the identifier:
Here's the output (I used STARTPAGE=NO just so all the output would fit on one page for posting):
FIRST.PDF
SECOND.PDF
THIRD.PDF
Another way to control what gets written to multiple ODS destinations or the same destination is to use a SAS Macro program to control the output being written. A third way is to write all the output to an ODS DOCUMENT store and then replay selected output objects to the desired destinations. But again, without more context or concrete examples, it is hard to guess.
Cynthia
Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!
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.
Ready to level-up your skills? Choose your own adventure.