11-02-2016 11:46 AM
I want to be able to produce a long document for review. I currently have a number of programs that each create a single table or figure which I want to combine into a single long document.
I want to use an RTF sandwich with the %include function calling each individual program to insert each table. So I'm thinking of having one program called combine.sas which does the following:
ods rtf file="long_file.rtf";
ods rtf close;
The problem is each of the table1, table2, etc, programs are quite long with lots of procs and datasteps. Is there an easy way I can restrict these programs so that they only send the final proc report to the RTF file in the combine.sas program?
For instance in table1.sas I use proc genmod with an ods output statement to save parameter estimates, then adapt these estimates in a data step to make them ready for outputing in the final proc report. Can I stop the proc genmod output from appearing in the final long_file.rft?
11-02-2016 12:04 PM
As far as I can recall, ODS desinations remain open until closed and capture all output. Therefore you would need to modify the individual ouput procedures, i.e. put noprint option into those procedures which generate output as default - you should really be deciding this when coding your procedures anyway, its rarely a good idea to leave uneccesary output being sent anyways.
Alternatively, output all your required outputs to RTF files and combine them into one at the end.
11-03-2016 05:50 AM
Thats code dependant, I wouldn't have thought that it would affect most normal operations (e.g. if you had an out=, or used ods output), but some of the fancy stats procedures are really awful to deal with so wouldn't put it past them.
11-02-2016 12:23 PM
You can use the ODS SELECT and EXCLUDE statements to choose which tables are added to your final document. Notice that you can optionally specify individual destinations in these statements, so that you could (if you wanted to) add a table or graph to an RTF report but exclude it from an HTML web page.
If that's not enough control, check out the ODS DOCUMENT destination. You can route all your output into a document, then selectively replay it to an RTF file.