BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.

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*/屏幕截图 2023-04-23 000020.png

/*THIS TEMPLATE OF SAS ,WHAT SHOULD I CHAGE TEMPLATE JUST LIKE MY SCHOOL ORDER TEMPLATE */

屏幕截图 2023-04-23 000224.png

1 ACCEPTED SOLUTION
4 REPLIES 4
maguiremq
SAS Super FREQ

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.

 

maguiremq_0-1682180511091.png

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;
_Sas_Beginner_
Quartz | Level 8
👍Thanks for your reply,I had solved this question, but only a top answer! I m sorry !!
ballardw
Super User

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.

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

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
  • 4 replies
  • 390 views
  • 2 likes
  • 4 in conversation