TEMPLATE Procedure: Creating Markup Language Tagsets

DEFINE TAGSET Statement

Creates a tagset.
Requirement: An END statement must be the last statement in the template.

Syntax

DEFINE TAGSET tagset-path | Base.Template.Tagset
DEFINE EVENT event-name;
statements and attributes
NOTES 'text';
END;

Summary of Optional Arguments

Required Arguments

tagset-path
specifies where to store the tagset.
Default:PROC TEMPLATE writes the template to the first template store in the current path where you have Write access.
Requirement:A tagset-path consists of one or more namesthat are separated by periods. Each name represents a directory, or level, in a template store.
Tips:Use the ODS PATH statement to control the item store where the tagset is stored.

Names are not case sensitive. However, PROC TEMPLATE puts the first letter in uppercase for easier reading.

Base.Template.Tagset
creates a tagset that is the parent of all tagsets that do not explicitly specify a parent. After this template is created, you do not need to explicitly specify it in your SAS programs. It is automatically applied to all output until you specifically remove it from the item store.
CAUTION:
The Base.Template.Tagset supplied by SAS contains information used by many tagsets. If this information is not retained, unexpected behavior might occur. To safely create your own Base.Template.Tagset, you can start with the existing Base.Template.Tagset template by writing it to an external file and editing the existing template contents.
Interaction:The Base.Template.Tagset master template attributes are overridden by other tagsets.
Tip:To view an existing tagset to base your own Base.Template.Tagset on, see Viewing the Contents of a Tagset.

Optional Argument

STORE=libref.template-store
specifies the template store where the template is stored in the following form:
libref.template-store <access-option(s)>
libref.template-store
specifies the current template store.
Default:If you omit an access-option, then the template-store is accessed with UPDATE permissions unless you have Read-Only access.
Tip:If the specified template store does not exist, then it is created.
access-option(s)
specifies the access mode for the specified template store.
READ
provides Read-Only access.
WRITE
provides Write access as well as Read access. If the tagset does not exist, then WRITE access creates a new tagset. If the tagset does exist, then WRITE access does not replace an existing tagset.
UPDATE
provides Update access as well as Read access. If the tagset does not exist, then UPDATE does not create a new tagset. If the tagset does exist, then UPDATE will replace it.
Restriction:The STORE= option syntax does not become part of the compiled template.
Interaction:The STORE= option overrides the search list specified in the PATH statement.

Tagset Attributes

Tagset Attributes by Task
Task
Attribute
Specify the maximum number of characters that will be considered for forced line breaks by ODS
BREAKTEXT_LENGTH=
Specify the maximum ratio of the width of space available for text entry to the length of the text that is supposed to fit in that space
BREAKTEXT_RATIO=
Specify the maximum width of space available for text entry that ODS will consider for placement of automatic line breaks
BREAKTEXT_WIDTH=
Specify the text to use as a copyright
COPYRIGHT=
Specify the name of the event to use by default
DEFAULT_EVENT=
Specify whether the tagset supports embedded style sheets
EMBEDDED_STYLESHEET=
Specify a comma-delimited list of image types or file extensions that are valid for an output destination
IMAGE_FORMATS=
Specify the number of spaces the NDENT and XDENT event statements will indent the output
INDENT=
Specify a string, which is printed to the SAS log when the tagset is used
LOG_NOTE=
Specify special characters and their translations
MAP=
Specify strings to substitute for special characters
MAPSUB=
Set a category for the output
OUTPUT_TYPE=
Specify whether a byte-order mark is written to the output files when using a UTF character set
NO_BYTE_ORDER_MARK=
Define a nonbreaking space for the markup output
NOBREAKSPACE=
Specify the tagset from which the current template inherits
PARENT=
Specify whether all style attributes are available at all times
PURE_STYLE=
Specify the text to use as a registered trademark
REGISTERED_TM=
Define a string to use for line breaks in the markup output
SPLIT=
Specify whether the tagset lets procedures place columns on top of each other, or side by side
STACKED_COLUMNS=
Specify the text to use as a trademark
TRADEMARK=
BREAKTEXT_LENGTH=number
specifies the maximum number of characters that will be considered for forced line breaks by ODS. When the number of characters in the text exceeds the number specified by the BREAKTEXT_LENGTH= option, then line breaks are inserted by the application that displays the output. If the number of characters in the text is less than or equal to the number specified by the BREAKTEXT_LENGTH= option, then any necessary line breaks are inserted by ODS. The placement of the line breaks is based on the total available text width.
Example:To instruct ODS to not insert line breaks in text that is longer than 80 characters, specify the following:
BreakText_Length=80;
BREAKTEXT_RATIO=number
specifies the maximum ratio of the width of space available for text entry to the length of the text that is supposed to fit in that space. If the ratio of width space to text length is greater than the ratio specified by the BREAKTEXT_RATIO= option, then any necessary line breaks are inserted by the application that displays the output. If the ratio of width space to text length is equal to or less than the ratio specified by the BREAKTEXT_RATIO= option, then any necessary line breaks are inserted by ODS.
Example:To not insert line breaks into text that is more than 1.5 times longer than the width of space that it is to fit in, specify the following:
BreakText_Ratio=1.5;
BREAKTEXT_WIDTH=number
specifies the maximum width of space available for text entry that ODS will consider for placement of automatic line breaks. If the width of space is greater than the number specified by the BREAKTEXT_WIDTH= option, then any necessary line breaks are inserted by the application that displays the output. If the width of space is less than or equal to the number specified by the BREAKTEXT_WIDTH= option, then ODS inserts necessary line breaks.
Example:To instruct ODS to not insert line breaks in text that is going into a space greater than or equal to 40 characters wide, specify the following:
BreakText_Width=40;
COPYRIGHT= '(text)'
specifies the text to use as the copyright.
Requirement:When specifying text, enclose the text in parentheses and then quotation marks.
DEFAULT_EVENT= 'event-name'
specifies the name of an event to execute by default when the requested event cannot be found in the tagset.
Requirement:When specifying an event-name, enclose the name of the event in quotation marks.
EMBEDDED_STYLESHEET= YES | ON | NO | OFF
specifies whether the tagset supports embedded style sheets.
YES
supports embedded style sheets.
Alias:ON
ON
supports embedded style sheets.
Alias:YES
NO
does not support embedded style sheets.
Alias:OFF
OFF
does not support embedded style sheets.
Alias:NO
Default:The default value is YES or ON, which means that embedded stylesheets are supported.
Tip:If embedded style sheets are supported and you do not specify a style sheet in the ODS statement, then the style sheet is written to the top of the output file.
IMAGE_FORMATS= 'image-type(s)'
specifies a comma-delimited list of image types or file extensions that are valid for an output destination. The image types can be any that are supported by SAS/GRAPH. List them in order of preference.
Example:The following IMAGE_FORMATS= statement lists valid image types for the HTML destination:
image_formats='gif,jpeg,png';
INDENT=n
specifies how many spaces the NDENT and XDENT event statements will indent the output.
n
specifies a numeric value for the number of spaces that you want the output to indent.
Default:0
Tip:The INDENT= attribute is valid only in markup family destinations.
LOG_NOTE= 'string'
defines a string that is printed to the SAS log when the tagset is used.
string
specifies the text that is printed to the SAS log.
Requirement:Specify only one string at a time.
MAP= 'characters'
specifies the special characters that require translation.
characters
specifies one or more special characters.
Requirements:When listing special characters in the MAP= statement, omit blank spaces between them.

When you specify special characters, enclose the list of special characters in quotation marks.

Use the MAP= statement with the MAPSUB statement.

MAPSUB= 'strings'
specifies the text to substitute for the characters that are specified in the MAP= statement.
strings
specifies the text strings to substitute for the characters that are specified in the MAP= statement.
Requirements:When specifying multiple strings, use a forward slash (/) to separate the text strings.

When specifying strings, enclose the entire string list in quotation marks.

Use the MAPSUB= statement with the MAP= statement.

NOBREAKSPACE= 'string'
defines a nonbreaking space for the markup output.
string
specifies the character that defines a nonbreaking space.
Restriction:Specify only one string at a time.
Requirement:When specifying a string, enclose the string in quotation marks.
NO_BYTE_ORDER_MARK=YES | ON | NO | OFF
specifies whether a byte-order mark is written to the output files when using a UTF character set.
OUTPUT_TYPE= CSV | HTML | LATEX | WML | XML
sets a category for the output.
CSV produces output with comma-separated values.
HTML produces Hypertext Markup Language output.
LATEX produces output in LaTeX, which is a document preparation system for high-quality typesetting.
WML uses the Wireless Application Protocol (WAP) to produce a wireless markup language.
XML produces output in Extensible Markup Language.
PARENT= tagset-path
specifies the tagset from which the current template inherits.
tagset-path
specifies the name of a directory in a template store.
Default:The current template inherits from the specified template in the first template store where you have Read access. The PATH statement specifies which locations to search for templates that were created by PROC TEMPLATE, as well as the order in which to search for them.
Requirement:When you specify a parent, all of the template options, attributes, and statements that are specified in the parent's template are used in the current template, unless the current template overrides them.
Tips:Specify a tagset that SAS supplies or a customized tagset.

Control the item store from which the tagset is read by using the ODS PATH statement.

PURE_STYLE=YES | ON | NO | OFF
specifies whether all of the style attributes are available at all times.
REGISTERED_TM= '(text)'
specifies the text to use as the registered trademark.
Requirement:When specifying text, enclose the text in parentheses and then quotation marks.
SPLIT= 'string'
defines a text string to use for line breaks in the markup output.
Restriction:Specify one string at a time.
Requirement:When specifying a string, enclose the string in quotation marks.
STACKED_COLUMNS= YES | ON | NO | OFF
specifies whether the tagset lets procedures stack columns on top of each other, or place them side by side.
YES
stacks columns on top of each other.
Alias:ON
ON
stacks columns on top of each other.
Alias:YES
NO
stacks columns side by side.
Alias:OFF
OFF
stacks columns side by side.
Alias:NO
Default:The default value is YES or ON, which means that columns are stacked.
Tip:To place columns side by side, specify the NO or OFF value.
TRADEMARK= '(text)'
specifies the text to use as the trademark.
Requirement:When specifying text, enclose the text in parentheses and then quotation marks.