The syntax for the HTML Tabulate Formatter is
%TAB2HTM(argument=value, argument=value,...);
You must include the Tabulate Formatter macro call with your SAS code. You cannot call it from a SAS command line. When including the macro call in your SAS code, you can use a list of arguments that are contained within parentheses and are separated with commas. You must end the invocation with a semicolon.
When naming files, avoid using certain reserved names. Click here to view a list of reserved names.
Note: Table support varies across browsers. Some of the formatting attributes supported by the Tabulate Formatter are not recognized by all browsers. In most cases, a browser will ignore HTML tags that it does not recognize; however, this may produce undesirable output.
The Tabulate Formatter macro lets you change how information is saved and formatted, described in the following sections of this page:
Most of the following arguments are required for the macro invocation. If the argument is required only in some cases, the exceptions are noted.
capture=ON | OFF
CAPTURE=ON
as one of
the arguments. Do not include any formatting arguments in the
CAPTURE=ON
statement. (The Tabulate Formatter
looks at formatting arguments only when you turn capturing
off, not on.)
To stop capturing and write the formatted HTML to the
specified file, you must invoke the macro again and
include CAPTURE=OFF
in the parameter list. To
specify formatting arguments and override the defaults set
in the selected property list, enter formatting arguments
when you stop capturing. Remember to include a matching
CAPTURE=OFF
for each CAPTURE=ON
argument.
IMPORTANT: Be sure that your program generates output only from PROC TABULATE while capturing is turned on. The HTML Tabulate Formatter will fail or produce unpredictable results if other type of output is also captured. To capture other types of output, use the HTML Output Formatter.
formchar=value
htmlfile=external-filename
Note: HTMLFILE
and HTMLFREF
are
mutually exclusive arguments.
htmlfref=fileref
Note: HTMLFILE
and HTMLFREF
are
mutually exclusive arguments.
openmode=APPEND | REPLACE
APPEND
to add your new HTML-enhanced output to
the end of an existing file. This argument is required only
if you want to override the default setting.
REPLACE
, the default, deletes the information in
an existing file and replaces it with the new output.
Note: OPENMODE=APPEND
is not valid is you are
writing your resulting HTML to a PDS on z/OS.
proploc=property-list-name
runmode=I | B
RUNMODE=B
when running in batch mode to avoid
confusion. You must include the argument when running in
interactive mode, which is available only with Release 6.12
of SAS software.
If you are using the Tabulate Formatter with the
Application Dispatcher, you must use
RUNMODE=S
. Using RUNMODE=S
tells
the formatter to print the HTTP header required by the Application
Dispatcher before creating any output. For more information, refer to the SAS/IntrNet Application Dispatcher
documentation at http://support.sas.com/documentation.
The remaining arguments provide formatting information and represent the properties that you can change to create customized HTML output.
Note: The Tabulate Formatter does not check for errors on fonts, colors, or sizes you specify. It simply allows any value you type. So, you should specify values that are supported on the system where the HTML page will be viewed.
These arguments apply to the entire page for the current invocation of the macro. So, if you append data, the attributes of existing results do not change. You may want to use these arguments only when you replace, rather than append, pages. The rendering of some formatting arguments vary per browser. Some browsers may not support all of these options.
To use the browser's attribute settings for those
arguments below where DEFAULT
is an option, specify
DEFAULT
. (Using DEFAULT
tells the
Tabulate Formatter to ignore settings in the property list.)
Otherwise, specify the value, for example, the color.
bgtype=NONE | COLOR | IMAGE
COLOR
or IMAGE
as the
value, you must also use the BG
argument. Valid
values for BGTYPE
are
NONE
COLOR
BG
argument. If you
specify COLOR
as the value, you must also
specify the color in the BG
argument.
IMAGE
IMAGE
as the
value, you must also specify the BG
argument to provide the name and location of the image.
Some browsers may not support the use of background
images.
bg=value
BGTYPE=IMAGE
, this identifies
the fully-qualified path and filename of a background image
that you want to use on your Web page. If you specified
BGTYPE=COLOR
, this indicates the specific
background color you want to use on your page. You can
specify color values using the color name or the RGB value.
brtitle=value
center=Y | N
N
).ctext=value | DEFAULT
TCOLOR
argument overrides the value specified by
CTEXT
. You can specify color values using the
color name or the RGB value. doctype=3.2 |
value
DOCTYPE
tag in the HTML file. The default value
is 3.2
, which writes the following line to the
top of your HTML file:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
If you want something other than the default text, you can
provide the exact line to be added. If you supply a blank
for value
, nothing is added to the top
of the file. If you supply a value other than 3.2, you
must include the exact text that you want added.
For example, if you want to reference a different DTD, you
must provide the entire string, including
!DOCTYPE
and the opening and closing angle
brackets.
encode=Y | N
Y
. This will display the actual brackets
in the browser. By default, the brackets will be encoded. To
not encode them and have the Tabulate Formatter pass the
brackets to the browser (where the browser will attempt to
act on them as an HTML-formatting instruction), specify
N
. pagepart=ALL | HEAD |
BODY | FOOT
ALL
HEAD
HEAD
when you
are going to append additional output from one of the
Formatters to this file.BODY
FOOT
For more information, see Using Page Formats.
saspower=value
Note: To display an image and automatically link to the
SAS Web site when running in interactive mode, you must
include the argument along with the %TAB2HTM
macro call. The following example shows how to include the
SASPOWER
argument in interactive mode:
%tab2htm(runmode=i, saspower=saspower.gif);
Use of this image is by permission only. See the Powered by SAS logo guidelines and agreement. |
septype=NONE | RULE | IMAGE
NONE
RULE
<HR>
tag (a horizontal
rule) to the HTML file following the end of the page.
IMAGE
IMAGE
, you must
also specify the SEPLOC
argument to
provide the name and location of the image that you
want to use.
seploc=image-location
SEPTYPE=IMAGE
. The value
for this argument should be a fully-qualified pathname or
valid URL.
Use the following attributes to define the formatting structure
of the table. These attributes contribute information to the
HTML <TABLE>
tag.
border=Y | N
Y
, which turns borders on for the table. The
width of the border is determined by the value of the
BWIDTH
argument.bwidth=value
1
.cpad=value
1
. The value specified for this
argument is represented in the HTML as
CELLPADDING
.cspace=value
1
. The value
specified for this argument is represented in the HTML as
CELLSPACING
.talign=LEFT | CENTER | RIGHT
CENTER
.
Some browsers produce unexpected results with multiple tables
and anything other than CENTER
. tbbgcolr=value | DEFAULT
BXBGCOLR, CLBGCOLR, RLBGCOLR
, or
DBGCOLR
arguments, which override the setting of
TBBGCOLR
.twidth=value
0
, which lets the browser determine the optimum
table width. The units for this value are determined by the
TWUNITS
argument.twunits=PERCENT | PIXELS
PERCENT
.
The following three elements require some explanation:
BOX=PAGE
is specified. If so, then the
text used as page dimension will be displayed in the box
cell. BOX
option of PROC TABULATE. (CONTINUED)
that PROC TABULATE generates when a
table is split across a page. For further details, refer to the SAS Procedures Guide.
Here's another way to look at how the Tabulate Formatter lets you change format options. The following illustration lists the table elements and indicates whether you can change the text color, font, font size, background color, or vertical or horizontal alignment. To go directly to the section that describes a table element, click on that element name in the following table:
Table element | Text color | Font and font size |
Background color |
Alignment | HTML tag |
---|---|---|---|---|---|
Title lines |
Yes |
Yes |
Yes |
||
By lines |
Yes |
Yes |
Yes |
||
Table caption |
Yes |
Yes |
Yes |
Yes |
|
Table box cell |
Yes |
Yes |
Yes |
Yes |
Yes |
Table column label cells |
Yes |
Yes |
Yes |
Yes |
Yes |
Table row label cells |
Yes |
Yes |
Yes |
Yes |
Yes |
Table data cells |
Yes |
Yes |
Yes |
Yes |
Yes |
Continuation line |
Yes |
Yes |
Yes |
||
Footnote lines |
Yes |
Yes |
Yes |
The following information describes each of the arguments that control the formatting of individual elements in the PROC TABULATE output. If you specify formatting information for an element not included in your table, the information is ignored.
To use the browser's attribute settings for those arguments
below where DEFAULT
is an option, specify
DEFAULT
. (Using DEFAULT
tells the
Tabulate Formatter to ignore settings in the property list.)
Otherwise, specify the value, for example, the color. This
applies only to color, face, and size arguments; it does not
apply to tag or alignment arguments.
When you specify any of these arguments, an HTML tag such as
<FONT COLOR=value>
is added to all the
appropriate lines in your HTML-formatted output.
tcolor=value | DEFAULT
tface=value | DEFAULT
tsize=value | DEFAULT
N
, +N
, and
-N
, where N
is an integer. Valid
values for N
are browser specific.ttag=value
PREFORMATTED + HEADER 3
.
For a list of all of the valid HTML tag names that you can use with this argument, see the list of available tags provided with the Tabulate Formatter.
bcolor=value | DEFAULT
bface=value | DEFAULT
bsize=value | DEFAULT
N
, +N
, and
-N
, where N
is an integer. Valid
values for N
are browser specific.btag=value
PREFORMATTED TEXT
.
For a list of all of the valid HTML tag names that you can use with this argument, see the list of available tags provided with the Tabulate Formatter.
The table caption displays text that PROC TABULATE uses as the page dimension. Refer to the subsection entitled Table element formatting introduction for more information.
ccolor=value | DEFAULT
cface=value | DEFAULT
chalign=LEFT | CENTER | RIGHT
LEFT
, aligns the caption text to the
left. Specify RIGHT
(or CENTER
) if
you want the caption text aligned to the right (or
center).csize=value | DEFAULT
N
, +N
, and
-N
, where N
is an integer. Valid
values for N
are browser specific.ctag=value
NO FORMATTING
.
For a list of all of the valid HTML tag names that you can use with this argument, see the list of available tags provided with the Tabulate Formatter.
cvalign=TOP | BOTTOM
TOP
, locates the caption text above the
table. Specify BOTTOM
if you want the caption
text to appear below the table.
The box cell is the cell that is generated by the BOX option of PROC TABULATE. Refer to the subsection entitled Table element formatting introduction for more information.
bxbgcolr=value | DEFAULT
bxcolor=value | DEFAULT
bxface=value | DEFAULT
bxhalign=LEFT | RIGHT | CENTER
bxsize=value | DEFAULT
N
, +N
, and
-N
, where N
is an integer. Valid
values for N
are browser specific. bxtag=value
NO FORMATTING
.
For a list of all of the valid HTML tag names that you can use with this argument, see the list of available tags provided with the Tabulate Formatter.
bxvalign=TOP | BOTTOM | MIDDLE | BASELINE
bxwrap=Y | N
N
), which is
consistent with the behavior in previous releases.
clbgcolr=value | DEFAULT
clcolor=value | DEFAULT
clface=value | DEFAULT
clhalign=LEFT | RIGHT | CENTER
clsize=value | DEFAULT
N
, +N
,
and -N
, where N
is an integer.
Valid values for N
are browser specific. cltag=value
NO FORMATTING
.
For a list of all of the valid HTML tag names that you can use with this argument, see the list of available tags provided with the Tabulate Formatter.
clvalign=TOP | BOTTOM | MIDDLE | BASELINE
clwrap=Y | N
N
), which is
consistent with the behavior in previous releases.
rlbgcolr=value | DEFAULT
rlcolor=value | DEFAULT
rlface=value | DEFAULT
rlhalign=LEFT | RIGHT | CENTER
rlsize=value | DEFAULT
N
, +N
, and
-N
, where N
is an integer. Valid
values for N
are browser specific. rltag=value
NO FORMATTING
.
For a list of all of the valid HTML tag names that you can use with this argument, see the list of available tags provided with the Tabulate Formatter.
rlvalign=TOP | BOTTOM | MIDDLE | BASELINE
rlwrap=Y | N
N
), which is
consistent with the behavior in previous releases.
dbgcolr=value | DEFAULT
dcolor=value | DEFAULT
dface=value | DEFAULT
dhalign=LEFT | RIGHT | CENTER
dsize=value | DEFAULT
N
, +N
, and
-N
, where N
is an integer. Valid
values for N
are browser specific. dtag=value
NO FORMATTING
.
For a list of all of the valid HTML tag names that you can use with this argument, see the list of available tags provided with the Tabulate Formatter.
dvalign=TOP | BOTTOM | MIDDLE | BASELINE
dwrap=Y | N
N
),
which is consistent with the behavior in previous releases.
PROC TABULATE generates the continuation line, which contains
the string (CONTINUED)
when a table splits across
pages. Refer to the subsection entitled Table element formatting introduction
for more information.
cncolor=value | DEFAULT
cnface=value | DEFAULT
cnsize=value | DEFAULT
N
,
+N
, and -N
, where N
is
an integer. Valid values for N
are browser
specific.cntag=value
BOLD + ITALICIZED
.
For a list of all of the valid HTML tag names that you can use with this argument, see the list of available tags provided with the HTML Tabulate Formatter.
fcolor=value | DEFAULT
fface=value | DEFAULT
fsize=value | DEFAULT
N
,
+N
, and -N
, where N
is
an integer. Valid values for N
are browser
specific.ftag=value
PREFORMATTED + HEADER 3
.
For a list of all of the valid HTML tag names that you can use with this argument, see the list of available tags provided with the HTML Tabulate Formatter.
Note: Character transcoding is available only in version 1.1 and higher.
tranlist=transcoding-list-name
charset=character-set-name
The following arguments are valid for all formatters and are described in Syntax for Including Style Sheets:
sshref1-sshref5=value
sstype1-sstype5=value
ssrel1-ssrel5=value
ssrev1-ssrev5=value
sstitle1-sstitle5=value
ssmedia1-ssmedia5=value
ssfile1-ssfile5=value
ssfref1-ssfref5=value
bclass=value
bdclass=value
bxclass=value
cclass=value
clclass=value
cnclass=value
dclass=value
fclass=value
rlclass=value
sepclass=value
RULE
, the supplied value is used on the
CLASS
attribute of the HR
tag. For
an IMAGE
separator, the supplied value is used
on the CLASS
attribute of the IMG
tag. spclass=value
tclass=value
tbclass=value
Note: z/OS is the successor to the OS/390 and MVS operating systems. SAS/IntrNet 9.1 for z/OS is supported on the MVS, OS/390, and z/OS operating systems and, throughout this document, any reference to z/OS also applies to OS/390 and MVS, unless otherwise stated.