destination and creates RTF output.
Actions
Tip Sheet
The following goptions produce better RTF
output in PORTRAIT mode.
ODS
ODS
ODS
RTF
RTF
RTF
Tip
Tip
Tip
Sheet
Sheet
Sheet
ODS
RTF
Tip
Sheet
goptions reset=goptions
close
closes the RTF destination and the file that
Action
Action
Action
Syntax
Syntax
Syntax
is associated
with
it.Syntax
You cannot print the
Action
file until you close the destination.
ods
ods
ods
rtf
rtf
rtf
<(<ID=>identifier)>
<(<ID=>identifier)>
<(<ID=>identifier)>
<action>;
<action>;
<action>;
ods rtf <(<ID=>identifier)> <action>;
exclude exclusions(s) | all |none
IfIfyou
If
you
you
use
use
use
the
thethe
ODS
ODS
ODS
RTF
RTF
RTF
statement
statement
statement
without
excludes
objects
fromwithout
thewithout
RTF
If you
use
theoutput
ODS
RTF
statement
without
an
anan
action
action
or
oroptions,
or
options,
then
then
then
ititopens
opens
ititopens
the
thethe
RTF
RTF
destination.
anaction
action
oroptions,
options,
then
opens
theRTF
RTF
destination
destination
destination
and
and
and
creates
creates
creates
RTF
RTF
RTF
output.
output.
output.
destination
and
creates
RTF
output.
select selections(s) | all |none
selects output objects for the RTF
Actions
Actions
Actions
destination.
Actions
device=sasemf
target=sasemf xmax=7.5in ymax=10in;
®® ®
® RTF
RTF
RTF
RTF
and
and
and
SAS/GRAPH
SAS/GRAPH
SAS/GRAPH
The
following
goptions
produce better
RTF
and
SAS/GRAPH
output in LANDSCAPE mode.
RTF
RTF
RTF
supports
supports
supports
three
three
three
device
device
device
types,
types,
types,
SASEMF,
SASEMF,
SASEMF,
RTF
supports
three
device
types,
SASEMF,
goptions
reset=goptions
device=sasemf
PNG,
PNG,
PNG,
and
and
and
JPEG.
JPEG.
JPEG.
SASEMF
SASEMF
SASEMF
might
might
might
print
print
print
target=sasemf
xmax=10in
ymax=7.5in;
PNG, and JPEG. SASEMF might print
best;
best;
best;
ititisis
itthe
isisthe
default
default
graphics
graphics
graphics
device
device
device
when
when
when
best;
itthe
thedefault
default
graphics
device
when
none
none
none
is
is
specified.
specified.
is
specified.
none is specified.
ODS
ODS
ODS
RTF
RTF
RTF
ODS
RTF
Tip
Tip
Tip
Sheet
Sheet
Sheet
Tip
Sheet
goptions
goptions
goptions
reset=goptions
reset=goptions
reset=goptions
device=sasemf
device=sasemf
device=sasemf
goptions
reset=goptions
device=sasemf
target=sasemf
target=sasemf
target=sasemf
xmax=7.5in
xmax=7.5in
xmax=7.5in
ymax=10in;
ymax=10in;
ymax=10in;
target=sasemf xmax=7.5in ymax=10in;
goptions
goptions
goptions
reset=goptions
reset=goptions
reset=goptions
device=sasemf
device=sasemf
device=sasemf
goptions
reset=goptions
device=sasemf
target=sasemf
target=sasemf
target=sasemf
xmax=10in
xmax=10in
xmax=10in
ymax=7.5in;
ymax=7.5in;
ymax=7.5in;
target=sasemf xmax=10in ymax=7.5in;
This tip sheet places frequently used
information in one place, on one sheet of
paper, so you don’t have to search through the
online documentation. It also gives you
something to take home, type in, and try.
This tip sheet presents the most common
statements and attributes used in creating
output with the ODS RTF statement. This
statement opens, manages, or closes the RTF
destination, which produces RTF output, a form
of output that is read by Microsoft Word.
The
The
The
following
following
following
goptions
goptions
goptions
produce
produce
produce
better
better
better
RTF
RTF
RTF
The
following
goptions
produce
better
RTF
output
output
output
in
in
PORTRAIT
in
PORTRAIT
PORTRAIT
mode.
mode.
mode.
output in PORTRAIT mode.
show
close
close
close
close
writes
the
current
selection
exclusion
closes
closes
closes
the
the
RTF
RTF
destination
destination
destination
and
and
and
the
theor
the
file
file
that
that
that list
closesthe
theRTF
RTF
destination
and
thefile
file
® that
The
The
The
following
following
following
goptions
goptions
goptions
produce
produce
produce
better
better
better
RTF
RTF
RTF
log.
for thewith
RTF
destination
to print
the
SAS
isisassociated
is
associated
associated
with
with
it.
it.
You
it.
You
You
cannot
cannot
cannot
print
print
the
the
the
The
following
goptions
produce
better
RTF
is associated with it. You cannot print the
output
output
output
in
in
LANDSCAPE
in
LANDSCAPE
LANDSCAPE
mode.
mode.
mode.
file
filefile
until
until
until
you
you
you
close
close
close
the
the
the
destination.
destination.
destination.
output in LANDSCAPE mode.
file until you close the destination.
exclude
exclude
exclude
exclusions(s)
exclusions(s)
exclusions(s)
| |all
all
| all
|none
exclude
exclusions(s)
||none
all|none
|none
excludes
excludes
excludes
output
output
output
objects
objects
objects
from
from
from
the
the
RTF
RTF
excludes output objects fromthe
theRTF
RTF
destination.
destination.
destination.
destination.
Column
Column
Column
for
forfor
logo,
logo,
logo,
address,
address,
address,
and
and
and
trademark
trademark
trademark
info.
info.
info.
Column for logo, address, and trademark info.
ODS RTF
For complete information, refer to the
Base SAS® 9.2 documentation at
http://support.sas.com/v9doc
select
select
select
selections(s)
selections(s)
selections(s)
||all
all
| all
|none
select
selections(s)
||none
all|none
|none
selects
selects
selects
output
output
output
objects
objects
objects
for
for
for
the
the
the
RTF
selects output objects forRTF
theRTF
RTF
destination.
destination.
destination.
destination.
show
show
show
show
writes
writes
writes
the
thethe
current
current
selection
selection
selection
or
orexclusion
or
exclusion
list
listlist
writes
thecurrent
current
selection
orexclusion
exclusion
list
®® ®
for
forfor
the
the
the
RTF
RTF
RTF
destination
destination
destination
to
to
the
to
the
the
SAS
SAS
SAS
log.
log.
log.
®
for the RTF destination to the SAS log.
For
ForFor
complete
complete
complete
information,
information,
information,
refer
refer
refer
totothe
the
to the
For complete
®® ® information, refer to the
9.2
9.2®9.2
documentation
documentation
documentation
atat at
Base
Base
Base
SAS
SAS
SAS
Base SAS 9.2 documentation at
http://support.sas.com/v9doc
http://support.sas.com/v9doc
http://support.sas.com/v9doc
http://support.sas.com/v9doc
SAS INSTITUTE INC. WORLD HEADQUARTERS 919 677 8000 U.S. & CANADA SALES 800 727 0025
www.sas.com
SAS and all other SAS Institute Inc. product or service names are registered trademarks or trademarks
of SAS Institute Inc. in the USA and other countries. ® indicates USA registration. Other brand and
product names are trademarks of their respective companies. Copyright © 2007, SAS Institute Inc.
All rights reserved. 496475.0508
This
This
This
tip
tiptip
sheet
sheet
sheet
places
places
places
frequently
frequently
frequently
used
used
used
This tip sheet places frequently used
information
information
information
ininone
one
in one
place,
place,
place,
on
onon
one
one
one
sheet
sheet
sheet
of
of of
information in one place, on one sheet of
paper,
paper,
paper,
so
soyou
so
youyou
don’t
don’t
don’t
have
have
have
to
tosearch
to
search
search
through
through
through
the
thethe
paper, so you don’t have to search through the
online
online
online
documentation.
documentation.
documentation.
ItItalso
also
It also
gives
gives
gives
you
you
you
online documentation. It also gives you
something
something
something
to
totake
to
take
take
home,
home,
home,
type
type
type
in,
in,in,
and
and
and
try.
try.try.
something to take home, type in, and try.
This
This
This
tip
tiptip
sheet
sheet
sheet
presents
presents
presents
the
thethe
most
most
most
common
common
common
This tip sheet presents the most common
statements
statements
statements
and
and
and
attributes
attributes
attributes
used
used
used
inincreating
in
creating
creating
statements and attributes used in creating
output
output
output
with
with
with
the
thethe
ODS
ODS
ODS
RTF
RTF
RTF
statement.
statement.
statement.
This
This
This
output with the ODS RTF statement. This
statement
statement
statement
opens,
opens,
opens,
manages,
manages,
manages,
or
orcloses
or
closes
closes
the
thethe
RTF
RTF
RTF
statement opens, manages, or closes the RTF
destination,
destination,
destination,
which
which
which
produces
produces
produces
RTF
RTF
RTF
output,
output,
output,
aaform
form
a form
destination, which produces RTF output, a form
of
ofoutput
of
output
output
that
that
that
isisread
read
is read
by
byMicrosoft
by
Microsoft
Microsoft
Word.
Word.
Word.
of output that is read by Microsoft Word.
ODS
RTF
Tip
Sheet
ODS
RTF
Tip
Sheet
Basic
Usage
Basic
Usage
ods rtf <option(s)>;
ods rtf <option(s)>;
… procedure code …
… procedure
…
ods rtfcode
close;
ods rtf close;
Common
Options
Common
Options
anchor=”anchor-name”
anchor=”anchor-name”
specifies
root
name
anchor
specifies
thethe
root
name
forfor
thethe
anchor
tagtag
identifies
each
output
object.
thatthat
identifies
each
output
object.
ODS
RTF
Examples
ODS
RTF
Examples
This
code
snippet
create
output
This
code
snippet
willwill
create
thethe
output
filefile
“output.rtf”
with
a simple
table
of five
“output.rtf”
with
a simple
table
of five
observations.
observations.
ods rtf file="output.rtf";
odsproc
rtf print
file="output.rtf";
data=sashelp.class(obs=5);
proc print data=sashelp.class(obs=5);
run;
run;
ods rtf close;
ods rtf close;
newfile=proc|
table
| bygroup
| none
newfile=proc|
table
| bygroup
| none
controls
when
a new
RTF
is started.
controls
when
a new
RTF
filefile
is started.
startpage=no
| now
| yes
startpage=no
| now
| yes
controls
page
breaks.
controls page breaks.
style=style-definition
style=style-definition
specifies
style
definition
to use.
specifies
thethe
style
definition
to use.
text=”text-string”
text=”text-string”
inserts
a text
string
your
output.
inserts
a text
string
intointo
your
output.
author=”author-text”
author=”author-text”
inserts
string,
specify
inserts
thethe
texttext
string,
thatthat
youyou
specify
as as
author,
metadata
a file.
author,
intointo
thethe
metadata
of aoffile.
operator=”subject-text”
operator=”subject-text”
inserts
string,
specify
inserts
thethe
texttext
string,
thatthat
youyou
specify
as as
subject,
metadata
a file.
thethe
subject,
intointo
thethe
metadata
of aoffile.
title=”title-text”
title=”title-text”
inserts
string,
specify
inserts
thethe
texttext
string,
thatthat
youyou
specify
as as
the
title,
into
the
metadata
of
a
file.
the title, into the metadata of a file.
columns=n
columns=n
specifies
number
columns
to create
specifies
thethe
number
of of
columns
to create
each
page
of output.
on on
each
page
of output.
file=”filename”
file=”filename”
specifies
name
of the
specifies
thethe
name
of the
filefile
thatthat
willwill
contain
the
output
tables.
contain the output tables.
RTF
Metadata
Options
RTF
Metadata
Options
RTF
Specific
Options
RTF
Specific
Options
This
code
snippet
create
output
This
code
snippet
willwill
create
thethe
output
filefile
“style.rtf”
with
a simple
table
“style.rtf”
with
a simple
table
of of
fivefive
observations
using
the
style
template
observations using the style template
“Ocean”:
“Ocean”:
ods rtf file="style.rtf" style=Ocean;
odsproc
rtf print
file="style.rtf"
style=Ocean;
data=sashelp.class(obs=5);
proc print data=sashelp.class(obs=5);
run;
run;
ods rtf close;
ods rtf close;
bodytitle
bodytitle
Titles
footnotes
occur
in the
Titles
andand
footnotes
willwill
occur
as as
texttext
in the
RTF
used
Microsoft
RTF
filefile
andand
notnot
be be
used
forfor
Microsoft
Word
header
and
footer
controls.
Word header and footer controls.
prepage=”text-string”
prepage=”text-string”
specifies
a text
string
occurs
before
specifies
a text
string
thatthat
occurs
before
a a
table
on
a
page.
table on a page.
sasdate
sasdate
date
embedded
in the
RTF
TheThe
date
embedded
in the
RTF
filefile
willwill
be be
date
from
SAS
date
thethe
date
from
thethe
SAS
loglog
andand
notnot
thethe
date
that
the
RTF
file
is
opened.
that the RTF file is opened.
RTF
Table
Contents
Options
RTF
Table
of of
Contents
Options
contents
contents
inserts
a first
page
RTF
document
inserts
a first
page
on on
thethe
RTF
document
RTF
specifications
to create
thatthat
hashas
RTF
specifications
to create
a a
Table
of
Contents
from
information
Table of Contents from information
embedded
in the
RTF
embedded
in the
RTF
file.file.
toc_data
toc_data
notoc_data
notoc_data
allows
embedding
of table
of contents
allows
thethe
embedding
of table
of contents
information
in
the
RTF
file.
The
option
information in the RTF file. The
option
cancan
®
®
process
be
toggled
during
the
SAS
be toggled during the SAS process
creating
RTF
In SAS
9.1.3,
creating
thethe
RTF
file.file.
In SAS
9.1.3,
toc_data
was
the
default.
In
SAS
toc_data was the default. In SAS 9.2,9.2,
thethe
default
changed
to notoc_data.
default
waswas
changed
to notoc_data.
Since
Table
of Contents
is not
created
Since
thethe
Table
of Contents
is not
created
until
the
document
is
opened
in
Word,
until the document is opened in Word,
several
files
created
SAS
merged
several
files
created
by by
SAS
cancan
be be
merged
together
in
Word
and
a
new
updated
Table
together in Word and a new updated Table
of Contents
created
re-issuing
of Contents
cancan
be be
created
by by
re-issuing
thethe
field
instruction
embedded
on
the
leading
field instruction embedded on the leading
Table
of Contents
page.
Table
of Contents
page.
Table
of Contents
page
is created
TheThe
Table
of Contents
page
is created
by by
right-clicking
under
Table
of Contents
right-clicking
under
thethe
Table
of Contents
title
on
the
first
page.
A
pop
menu
suggests
title on the first page. A pop menu suggests
several
actions.
Choose
“Update
Field”.
several
actions.
Choose
“Update
Field”.