BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
glee217
Calcite | Level 5

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:

캡처.JPG캡처1.JPG

 

1 ACCEPTED SOLUTION

Accepted Solutions
Reeza
Super User

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;

 

View solution in original post

5 REPLIES 5
Reeza
Super User

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;

 

glee217
Calcite | Level 5
I have a question for locating file name.

Do i have to give them a name for physical data that i've referred to make
"proc tabulate data="?

Or is this arbitrary location that i will put my output as RTF after output?


If it's data name that i've used to create proc tabulate, i don't know how
to extract the address
cause it's in work as temporary file...:/


Cynthia_sas
SAS Super FREQ
Hi:
There is a difference between what you specify on data= in a PROC step -- that is the name of the INPUT data set and what you specify on FILE= in the ODS statement -- that is the OUTPUT destination file or OUTPUT report file.

The data= reference is OK to be in WORK because after ODS is done making the output from PROC TABULATE, it does not need the WORK data any longer. You open the file name specified in the FILE= option to get the "pretty" or RTF version of the file.

You need to decide on what to use for the FILE= option -- that name is under your control -- where do YOU want to write the RTF file?

In an earlier post, you said: "And i want to make output pretty as much as possible through ODS function." Reeza gave you some good suggestions -- but what do you mean by "pretty" and what do you mean by "as much as possible" -- you need to make the font 24 pt and red?

Look at pages 18-21 of this paper: http://support.sas.com/resources/papers/proceedings13/366-2013.pdf -- it covers style overrides with PROC TABULATE -- by starting from a fairly garish example to show you exactly how to touch every area in a TABULATE report.

cynthia
PGStats
Opal | Level 21

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;
PG
Ksharp
Super User
Another option.



ods tagsets.rtf file='c:\temp\x.rtf';
proc print data=sashelp.class;run;
ods tagsets.rtf close;


sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

What is Bayesian Analysis?

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.

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
  • 5 replies
  • 4291 views
  • 2 likes
  • 5 in conversation