I have some SAS output that needs to be printed in a tabular form and exported to a Word document. The SAS output has several sections corresponding to a group variable. So far I have;
1. Organize the output into a SAS data set. Use PROC PRINT with BY and ID statements to create a tabular output with separate sections according to the BY groups.
2. Use ods rtf to put the tabular output in a rtf file and proc template to change style settings.
The rtf output looks almost like what I need, except the table needs internal lines to delineate sections created by the “BY” statement in “PROC PRINT”. The options for “rules” in define styles in Proc Template does not seem to extend to this case.
Does anyone have any experience with doing this? Thanks for any tips/advice you can share!
I agree that the capability is not there in PROC PRINT. However if you combine RTF control strings with Proc Template, it is possible to get a line either ABOVE the byline or BELOW the byline.
I used the only RTF control strings that I know for lines: \brdrb (means border bottom) and \brdrs (means border solid) and \brdrt (means border top)
The first style template, in the program below, MYRTF_DIV has a line under the byline. For that template, you also need a line (\line) ABOVE the table, so that the line for the byline does not sit on top of the table.
The second style template, in the program below, MYRTF_ALT has a line above the by line. In this instance, you don't need a blank line on top of the table. And then the third style template just does a line above and a line below.
This may or may not be the look you want. I'm sure that with a little research into RTF control strings, you may be able to come up with a different look.