Hello experts, about my graduate thesis, my school requires this kind of opening statistical table, but the output in the RTF file is this gray table, I don't want to modify one by one in the WORD document, I know that there is a proc template process step to modify the output table form, but I don't know how to output in the RTF file, how can this be solved in SAS code?
/*THIS TEMPLATE IS MY SCHOOL ORDER ME*/
/*THIS TEMPLATE OF SAS ,WHAT SHOULD I CHAGE TEMPLATE JUST LIKE MY SCHOOL ORDER TEMPLATE */
Have a look at these papers, they provide information about the ODS Report Writer Object
I think the SasDocPrinterStyle is the one that is most similar. You can build a template from scratch to make it look the exact same, but this gets you to something similar. You can see the pre-defined styles here.
Now, if you want to get a summary line like that, you can use PROC REPORT to do it. I'm not sure what you've done so far.
Now, for code, you need to do something similar like this.
ods rtf file = "your-path-here.rtf" style = SasDocPrinter;
proc print data = sashelp.class;
run;
ods rtf close;
Example data provided as data step code and rules may get a more targeted solution.
You do not mention at all how your output was created. The report procedures Proc Tabulate and Report have lots of controls of appearance.
Basic appearance of a documented created with ODS RTF will default to using the Styles.RTF which sets fonts and such things as the shading in the column and row headers. Different ODS style options change general appearance as an option on your ODS destination statement.
ods rtf file="<path>\myfile.rtf" style=<style of choice>;
Then it is usually easier to set overrides in a reporting procedure such as Tabulate, Report or Print overriding default behavior if needed.
Some ODS destinations default to a specific style, such as RTF, some do not.
Most of the analysis procedures do not provide many options to control output. When you need a specific appearance of the results then create one or more output data sets from the procedure and then use one of the reporting procedures to create the appearance needed. Sometimes you need to modify the results of the analysis procedure output to make a pretty report.
Have a look at these papers, they provide information about the ODS Report Writer Object
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.