Hi i have 3 different tabulate tables in here
but i don't know how to create RTF output that i want to make.
And i want to make output pretty as much as possible through ODS function.
Can you help me pls?
Here's my code:
title1 "median";
proc tabulate data = mergediff;
class gender;
var CURRENT_BALANCE weekint;
table gender ALL, median*(CURRENT_BALANCE weekint);
run;
*Question 1(e);
*For upper quartile 5%;
title1 "upper quartile";
proc tabulate data = mergediff;
class gender;
var CURRENT_BALANCE weekint;
table gender ALL, P95*(CURRENT_BALANCE weekint);
run;
*For lower quartile 5%;
title1 "lower quartile";
proc tabulate data = mergediff;
class gender;
var CURRENT_BALANCE weekint;
table gender ALL, P5*(CURRENT_BALANCE weekint);
run;
Here's my output how it looks like:
ODS is pretty straightforward.
Here's a link to the the ODS Cheat Sheet for RTF:
https://support.sas.com/rnd/base/ods/odsrtf/rtf-tips.pdf
Without know how you want to 'style' your RTF its difficult to help beyond this.
This should get you started, rather than fully customize your style, I would suggest picking the style that's closes and modifying that. I find MEADOW and SEASIDE the best options for work reports, they're clear and not too flashy which looks juvenile.
ods rtf file='/folders/myfolders/mySample.rtf' style=meadow;
title1 "median";
proc tabulate data = mergediff;
class gender;
var CURRENT_BALANCE weekint;
table gender ALL, median*(CURRENT_BALANCE weekint);
run;
*Question 1(e);
*For upper quartile 5%;
title1 "upper quartile";
proc tabulate data = mergediff;
class gender;
var CURRENT_BALANCE weekint;
table gender ALL, P95*(CURRENT_BALANCE weekint);
run;
*For lower quartile 5%;
title1 "lower quartile";
proc tabulate data = mergediff;
class gender;
var CURRENT_BALANCE weekint;
table gender ALL, P5*(CURRENT_BALANCE weekint);
run;
ods rtf close;
ODS is pretty straightforward.
Here's a link to the the ODS Cheat Sheet for RTF:
https://support.sas.com/rnd/base/ods/odsrtf/rtf-tips.pdf
Without know how you want to 'style' your RTF its difficult to help beyond this.
This should get you started, rather than fully customize your style, I would suggest picking the style that's closes and modifying that. I find MEADOW and SEASIDE the best options for work reports, they're clear and not too flashy which looks juvenile.
ods rtf file='/folders/myfolders/mySample.rtf' style=meadow;
title1 "median";
proc tabulate data = mergediff;
class gender;
var CURRENT_BALANCE weekint;
table gender ALL, median*(CURRENT_BALANCE weekint);
run;
*Question 1(e);
*For upper quartile 5%;
title1 "upper quartile";
proc tabulate data = mergediff;
class gender;
var CURRENT_BALANCE weekint;
table gender ALL, P95*(CURRENT_BALANCE weekint);
run;
*For lower quartile 5%;
title1 "lower quartile";
proc tabulate data = mergediff;
class gender;
var CURRENT_BALANCE weekint;
table gender ALL, P5*(CURRENT_BALANCE weekint);
run;
ods rtf close;
You can also let proc tabulate generate the pages for you, for example:
ods rtf file="&sasforum.\Reports\tabulate report.rtf" style=journal;
options nodate nonumber;
Title "Sashelp.class statistics";
proc tabulate data=sashelp.class format=6.1;
class sex;
var height weight;
table
median="Median" p95="Upper quartile 5%" p5="Lower quartile 5%",
sex all,
height weight;
run;
ods rtf close;
Another option. ods tagsets.rtf file='c:\temp\x.rtf'; proc print data=sashelp.class;run; ods tagsets.rtf close;
Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9. Sign up by March 14 for just $795.
Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.