BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
mona4u
Lapis Lazuli | Level 10

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. 

1 ACCEPTED SOLUTION

Accepted Solutions
Quentin
Super User

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.

BASUG is hosting free webinars Next up: Don Henderson presenting on using hash functions (not hash tables!) to segment data on June 12. Register now at the Boston Area SAS Users Group event page: https://www.basug.org/events.

View solution in original post

2 REPLIES 2
Quentin
Super User

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.

BASUG is hosting free webinars Next up: Don Henderson presenting on using hash functions (not hash tables!) to segment data on June 12. Register now at the Boston Area SAS Users Group event page: https://www.basug.org/events.
Cynthia_sas
SAS Super FREQ

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:

Cynthia_sas_0-1664891642564.png

Here's the output (I used STARTPAGE=NO just so all the output would fit on one page for posting):

FIRST.PDF

Cynthia_sas_1-1664891729100.png

 

SECOND.PDF

Cynthia_sas_2-1664891786889.png

 

THIRD.PDF

Cynthia_sas_3-1664891866198.png

  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

 

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
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
  • 2 replies
  • 432 views
  • 4 likes
  • 3 in conversation