09-10-2013 03:36 PM
Is it possible to combine (collate) 2 ODS reports and output to 1 pdf instead of 2?
I have a summary and a detail report and want to collate and print to 1 file so end user doesn't need to collate. It will be a one-to-many as 1 summary sheet for many detail reports.
09-10-2013 03:38 PM
What type of ODS is your original? Do you have Adobe Professional?
I've used SAS to write a VB Script to combine files , but Adobe Professional has a fairly good automation tool as well.
You can also look at Proc Document to control when the outputs are displayed to get the files the way you want them.
09-10-2013 03:53 PM
Or it may just take a minor adjustment to your work flow. After you have the data ready put all of the output generating code within one ODS output "sandwich".
ods pdf file="mypdffile.pdf";
<first output procedure>
<second output procedure>
<last output procedure>
ods pdf close;
09-10-2013 04:09 PM
This is what I need to do, but getting the 'data ready' is my problem. One Summary Report (formatted in ODS) needs to PRECEDE each group of Detail Reports (formatted in ODS). The summary and detail reports are separate SAS datasets.
09-11-2013 11:13 AM
No problem. Just put the code to create each report in order. Could look like below. The datasets should be available to you as supplied by SAS for examples.
ods pdf file "mypdffile.pdf";
Proc means data=sashelp.class mean stddev;
var height weight;
title 'Summary of Height and Weight by Sex';
proc print data=sashelp.class noobs label;
title 'Heights and weights details';
var name sex height weight;
proc tabulate data=sashelp.cars;
table make, type*horsepower*mean;
title 'Average horsepower by make and type';
proc print data=sashelp.cars noobs label;
title 'Detail Horsepower by Make and Car Type';
var make type horsepower;
ods pdf close;
09-11-2013 11:59 AM
Great example Thanks! I am almost there. I will use the 'Horsepower by Make and Type' datasets to further explain.
I want to print groupings by Make summary then Make detail. So print the summary for Acura then the detail for Acura and continue to eof for all Makes. I tried building in 'do while' but it was unsuccessful.
09-11-2013 06:47 PM
You can do it via macro's if you want, how familiar are you with macro code? Is efficiency a concern, because this isn't very efficient.