Formatting Your Results

Using Tag Descriptions

The HTML Formatting Tools do not require you to know HTML tags. A default set of tag descriptions are supplied with the Formatting Tools. You use these tag descriptions, instead of the HTML tag, when formatting your output. Each tag description is associated with one or a combination of HTML tags. This association provides the formatting for elements in your output.

The HTML Formatting Tools enable you to create custom tag descriptions, change the HTML tag associated with the description, and change which tag description is used by any output element. You can perform all of these tasks either in batch mode or interactively. (Until Version 1.2 of the Formatting Tools, you could modify or create tag descriptions in interactive mode only. You can now create them using the EDITTAGS macro in batch mode.)

Take a look at the table that shows which HTML tags are associated with each tag description. As you can see, we provide a thorough list of tag descriptions. However, there are times when you need to create your own tags or will find it easier to use the tags if you rename the descriptions to a name you can remember. For example:

Associating a Tag Description with an Output Element

Each output element and line type has a default tag definition associated with it. You can change the associated tag definition by changing the property list for the Formatter or by specifying a tag definition using the appropriate macro argument when you submit the Formatter macro.

Because the macro arguments are specific to the Formatting Tool, you should refer to the documentation for each tool for information on associated a tag description. If you want to perform this task interactively, see the following:

If you want to perform this task in batch mode, go to the syntax reference for each Formatting Tool. Each output element and text line type have a tag attribute that enables you to associate a tag description with that element.

Creating, Modifying, and Deleting Tag Descriptions

The tag definitions are stored in the TAGS SLIST. All three Formatting Tools use the same TAGS list. (This is different from the property list; each tool uses its own property list.) The default TAGS list is stored in SASHELP.HTMLGEN.TAGS.SLIST. You should not delete or modify this list. When you modify or create tag descriptions, your changes are saved to SASUSER.HTMLGEN.TAGS.SLIST and each Formatting Tool checks this location first then SASHELP.HTMLGEN.TAGS.SLIST for tag definitions.

Because browsers support HTML tags and tag combinations differently, we strongly suggest that you test your tag definitions before creating and publishing output using the new tags.

When you modify a tag description, you change the HTML tags associated with the description. All output elements that are formatted using the modified tag description will have the new formatting the next time you run any of the Formatting Tools. So, be sure that you want all elements that use the tag description to be formatted using the new HTML tags. (You can easily check which output elements use which tag descriptions using the interactive method described previously in "Associating a Tag Description with an Output Element.")

When you create a tag description, you create a tag name that is not used for any other tag description and you define which HTML tags you want associated with the new description. You must specify by the beginning and ending HTML tag. If you are creating a description that used more than one HTML tag, you must end the tags in the correct order. For example, if you create a tag description that uses a bold tag and font tag, the beginning tags might be <font color=red><b>, which requires the ending tags to be </b></font>.

Customizing Tag Descriptions in Interactive Mode

You can create new tag descriptions or modify existing ones using the Edit HTML Tags window. This window (shown below) is the same for all Formatting Tools. You access it by selecting the Edit button on the Text Lines panel (Output Formatter), or the Element panel (Data Set and Tabulate Formatters) when you are interactively creating a custom property list.

Edit HTML Tags window

To delete, modify, or create tag descriptions:

When you are finished modifying the tags list, select the OK button to return to the previous window.


Customizing Tag Descriptions in Batch Mode

The EDITTAGS macro enables you to create, modify, and delete tag descriptions. The first time that you modify the tag descriptions provided with the Formatting Tools, your customized set of tag descriptions is saved to SASUSER.HTMLGEN.TAGS.SLIST. As long as this list exists, the Formatting Tools will use this list to format your output and data sets. Delete SASUSER.HTMLGEN.TAGS.SLIST to return to the default set of tag descriptions.

To create a custom tags list using the EDITTAGS macro, you will have to create a SAS data set that contains information about your tag modifications. Then, run the EDITTAGS macro against that data set. The macro saves the customized tag information to SASUSER.HTMLGEN.TAGS.SLIST. The following defines the syntax of the EDITTAGS macro. For more information, see Using the EDITTAGS Macro.

The syntax for the EDITTAGS macro is:

   %EDITTAGS (argument=value, argument=value, ...);
data=SAS-data-set-name

The one- or two-level name of the SAS data set that contains the information used to modify the tags list.

tagname=SAS-variable-name

The name of the SAS variable in the data set specified by DATA that contains the name of the tag to modify, add or delete. This variable must be of type character.

action=SAS-variable-name

The name of the SAS variable in the data set specified by DATA that contains the action to be performed for the corresponding value of TAGNAME. The value of ACTION must refer to a character variable whose value is ADD, DELETE or MODIFY.

In order to modify or delete a tag, the named item must already appear in the tags list. An item will not be added if a like-named item already exists.

starttag=SAS-variable-name

The name of the SAS variable in the data set specified by DATA that contains the HTML to be used for the starting tag for the corresponding value of TAGNAME. This variable must be of type character.

endtag=SAS-variable-name

The name of the SAS variable in the data set specified by DATA that contains the HTML to be used for the ending tag for the corresponding value of TAGNAME. This variable must be of type character.

For more information, see the example using the EDITTAGS macro.