Valid in: | Anywhere |
Category: | ODS: Third-Party Formatted |
Interaction: | By default, when you execute a procedure that
uses the FORMCHAR system option (for example, PROC PLOT or PROC CHART),
ODS formats the output in SAS Monospace font. If you are creating
output that will be viewed in an operating environment that does not
have SAS software installed, this output will not be displayed correctly.
The SAS Monospace font is not recognized if SAS is not installed.
For the correct display of your document, include the following statement
before your SAS program: OPTIONS FORMCHAR='|----|+|---+=|-/\<>*'; |
Tip: | Microsoft Word 2002 is the current official minimum level that is supported. However, no problems have been found with Microsoft Word 2000 and SAS RTF files. |
The following actions are available for the ODS TAGSETS.RTF statement:
tabulate
.
The second anchor is named tabulate1
;
the third is named tabulate2
, and so
on.
You can change anchor names as often as you want by submitting the ANCHOR= option in an ODS RTF statement anywhere in your program. After you specify an anchor name, it remains in effect until you specify a new one.
If you specify a value greater than the maximum number of one inch columns that can fit on the page, a note is printed to the SAS log that states what the maximum value can be for that page.
You must specify media-type next to the file-specification specified by the CSSSTYLE= option.
You cannot use the NEWFILE= option with the FILE=fileref option.
The TOC_DATA option must be set to YES to capture TOC data. If you specify CONTENTS=YES, but you do not specify TOC_DATA, no Table of Contents data is captured. The error displayed on the Table of Contents page is "Error! No table of contents entries found".
ods tagsets.rtf options (Tables_OFF='usertext'); ods tagsets.rtf text=”Text is not placed in a table”);
0
”
results in a fully expanded table of contents, while TOC_LEVEL=”2
”
results in a table of contents that is expanded to two levels.
ODS always determines the column widths and determines whether panels are required. When there are multiple panels, ODS attempts to place a reasonable number of rows in each panel.
RECORD_SEPARATOR= '0D0A'x
RECORD_SEPARATOR= '0D25'x
RS=
Note that when you specify the BODYTITLE= option, Microsoft Word no longer controls the placement of the headers and footers text. However, Word still controls other header and footer information, such as page number and date.
The UNIFORM option can cause SAS to run out of memory if you are printing a very large table. If this happens, you can specify the width of each of the columns in the table. Then print the table one page at a time. To do so, you must edit the table definition that you use. For more information, see What You Can Do with a Table Template .
The following diagnostic tagsets are available for the ODS TAGSET.RTF statement.
Features: |
|
Other features: |
OPTIONS statement PROC FORMAT PROC PRINT PROC SORT PROC REPORT PROC TABULATE |
Data set: | Grain_Production |
Format: | $CNTRY. |
ods html close;
proc sort data=Grain_Production; by year country type; run;
ods tagsets.rtf file='Grain_Tagset.rtf' options(contents='yes' toc_data='yes');
options nobyline; title 'Leading Grain-Producing Countries'; title2 'for #byval(year)';
proc report data=Grain_Production nowindows; by year; column country type kilotons; define country / group width=14 format=$cntry.; define type / group 'Type of Grain'; define kilotons / format=comma12.; footnote 'Measurements are in metric tons.'; run;
options byline; title2;
ods tagsets.rtf options(toc_data='no');
proc tabulate data=Grain_Production format=comma12.; class year country type; var kilotons; table year, country*type, kilotons*sum=' ' / box=_page_ misstext='No data'; format country $cntry.; footnote 'Measurements are in metric tons.'; run;
ods tagsets.rtf options(toc_data='yes');
proc print data=Grain_Production; run;
ods tagsets.rtf close; ods html;
proc report data=Grain_Production nowindows; by year; column country type kilotons; define country / group width=14 format=$cntry.; define type / group 'Type of Grain'; define kilotons / format=comma12.; footnote 'Measurements are in metric tons.'; run;
proc tabulate data=Grain_Production format=comma12.; class year country type; var kilotons; table year, country*type, kilotons*sum=' ' / box=_page_ misstext='No data'; format country $cntry.; footnote 'Measurements are in metric tons.'; run;
Features: |
|
Other features: |
PROC PRINT |
ods tagsets.rtf file='Help.rtf' options (doc='help');
proc print data=Sashelp.Class; run;
ods tagsets.rtf close;
Features: |
|
Other features: |
PROC PRINT |
ods tagsets.rtf file='tablesOff.rtf' options(TABLES_OFF='STYLE_ELEMENTS'); proc print data=sashelp.class(obs=1) ; run; ods tagsets.rtf text='TEXT is placed in a table by default' ;
ods tagsets.rtf options(TABLES_OFF='usertext' ); ods tagsets.rtf text='TEXT is not placed in a table (table is removed when style element is specified)' ;
ods tagsets.rtf options(TABLES_OFF='off' ); ods tagsets.rtf text='TEXT is placed in a table (returned to default when tables_off is set to off)' ;
ods tagsets.rtf close;
ods tagsets.rtf file='tablesOff.rtf' options(TABLES_OFF='STYLE_ELEMENTS'); proc print data=sashelp.class(obs=1) ; run; ods tagsets.rtf text='TEXT is placed in a table by default' ;
ods tagsets.rtf options(TABLES_OFF='usertext' ); ods tagsets.rtf text='TEXT is not placed in a table (table is removed when style element is specified)' ;
Features: |
|
Other features: |
PROC PRINT OPTIONS statement |
options orientation=landscape nodate nonumber;
ods html close;
ods tagsets.rtf file='Mrotate.rtf' OPTIONS (TRHDR='\trrh750' TROWHDRCELL='\cltxbtlr' TROWD='\rtlrow');
proc print data=Sashelp.Class(obs=5); run;
ods tagsets.rtf close; ods html;
ods tagsets.rtf file='Mrotate.rtf' OPTIONS (TRHDR='\trrh750' TROWHDRCELL='\cltxbtlr' TROWD='\rtlrow');
Features: |
|
Other features: |
OPTIONS statement PROC PRINT DATA statement |
option nodate nonumber;
ods html close;
ods tagsets.rtf file='Panel.rtf';
data temp; array values val1val50; do j = 1 to 6; do i = 1 to dim(values); values(i) = i; end; output; end; run;
ods tagsets.rtf; title Default Paneling; proc print data=Temp; run;
ods tagsets.rtf tablerows=5 pagepanels=4; title 'Paneling with TABLEROWS=5 and PAGEPANELS=4'; proc print data=Temp; run;
ods tagsets.rtf close; ods html;
data temp; array values val1val50; do j = 1 to 6; do i = 1 to dim(values); values(i) = i; end; output; end; run;
ods tagsets.rtf tablerows=5 pagepanels=4; title 'Paneling with TABLEROWS=5 and PAGEPANELS=4'; proc print data=Temp; run;
Features: |
ODS RTF statement |
Other features: |
OPTIONS statement PROC FORMAT PROC TABULATE DATA statement |
ods html close;
options orientation=landscape; ods rtf file='RtfTab.rtf';
ods tagsets.rtf file='MrtfTab.rtf' uniform;
data one; do a=1 to 2; do b=1 to 2; do c=1 to 3; do d=1 to 3; do e=1 to 5; output; end; end; end; end; end; run;
proc format; value cars 1='DATSUN 200SX' 2='PONTIAC FIERO'; value colors 1='RED' 2='LIGHT BLUE' 3='YELLOW' 4='GREEN' 5='BROWN'; value luxury 1='ALL THE WAY' 2='STANDARD OPTIONS' 3='STRIPPED DOWN'; value opts 1='POWER STEERING' 2='SUN ROOF' 3='AUTOMATIC' 4='T-TOP' 5='HATCHBACK' 6='FUEL-INJECTION' 7='HUBCAPS' 8='AM/FM STEREO' 9='FLOOR MATS' 10='CASSETTE PLAYER'; value perform 1='VERY SLOW' 2='SLOW' 3='AVERAGE' 4='FAST' 5='VERY FAST'; run;
data two (keep=model color luxury options perform); length model color luxury options perform $ 20; set one; model=put(a,cars.); color=put(b,colors.); luxury=put(c,luxury.); options=put(d,opts.); perform=put(e,perform.); run;
title2 'My Favorite Cars'; title3 '(large data set)';
proc tabulate data=two order=data ; class model color luxury options perform; table model*color*luxury*options*perform,n / indent=4 condense; label model='MODEL CAR' color='COLOR OF CAR' luxury='CONDITION OF CAR' perform='SPEED'; keylabel n='NUMBER'; run;
ods _all_ close; ods html;
data one; do a=1 to 2; do b=1 to 2; do c=1 to 3; do d=1 to 3; do e=1 to 5; output; end; end; end; end; end; run;
proc format; value cars 1='DATSUN 200SX' 2='PONTIAC FIERO'; value colors 1='RED' 2='LIGHT BLUE' 3='YELLOW' 4='GREEN' 5='BROWN'; value luxury 1='ALL THE WAY' 2='STANDARD OPTIONS' 3='STRIPPED DOWN'; value opts 1='POWER STEERING' 2='SUN ROOF' 3='AUTOMATIC' 4='T-TOP' 5='HATCHBACK' 6='FUEL-INJECTION' 7='HUBCAPS' 8='AM/FM STEREO' 9='FLOOR MATS' 10='CASSETTE PLAYER'; value perform 1='VERY SLOW' 2='SLOW' 3='AVERAGE' 4='FAST' 5='VERY FAST'; run;
data two (keep=model color luxury options perform); length model color luxury options perform $ 20; set one; model=put(a,cars.); color=put(b,colors.); luxury=put(c,luxury.); options=put(d,opts.); perform=put(e,perform.); run;
proc tabulate data=two order=data ; class model color luxury options perform; table model*color*luxury*options*perform,n / indent=4 condense; label model='MODEL CAR' color='COLOR OF CAR' luxury='CONDITION OF CAR' perform='SPEED'; keylabel n='NUMBER'; run;