TEMPLATE Procedure: Creating Crosstabulation Table Templates

DEFINE HEADER Statement

Creates a header template.
Note: The DEFINE HEADER statement begins a header template block. The following statements are commonly used within a DEFINE HEADER block: DYNAMIC Statement, NOTES Statement, and TEXT Statement.
See: Creating a Customized Crosstabulation Table Template with No Legend

Syntax

DEFINE HEADER symbol;
DYNAMIC variable-1<'text-1'> < variable-n<'text-n'>>;
NOTES 'text';
TEXT header-specification </ expression>;
END;

Summary of Optional Arguments

Specify alignment for headers and footers that wrap
Specify the number of blank lines to place between the current header and the next header or between the current footer and the previous footer
Specify the style element and any changes to its attributes to use for the header or footer

Required Argument

symbol
specifies a name to be referenced by the HEADER statement.

DEFINE HEADER and DEFINE FOOTER Attribute Statements

This section lists the attributes that you can use in a header or footer template.
DEFINE HEADER and DEFINE FOOTER Attribute Statements
Task
Attribute
Specify alignment for headers and footers that wrap
CINDENT='character'
Specify the number of blank lines to place between the current header and the next header or between the current footer and the previous footer
SPACE=positive-integer
Specify the style element and any changes to its attributes to use for the header or footer
STYLE=<[style-element-specification(s)]>
CINDENT='character'
specifies alignment for headers or footers that wrap. If a header or footer is too wide to fit on a single line, insert the specified character at the column position at which the second and subsequent lines should start. The first use of the CINDENT character determines the column position. For example, the following TEXT statement makes wrapped lines start at the same column as the left parenthesis:
text _COL_NAME_ "(;" _COL_LABEL_ ")"; CINDENT=';';
SPACE=positive-integer
specifies the number of blank lines to place between the current header and the next header or between the current footer and the previous footer.
Default:0 for headers and 1 for footers
Tip:The SPACE= attribute is valid only in the LISTING destination.
STYLE=<[style-element-specification(s)]>
specifies the style element and any changes to its attributes to use for the current column. Neither style-attribute-specification nor style-element-name is required. However, you must use at least one of them. You can use braces ({ and }) instead of square brackets ([ and ]).
style-element-name
is the name of the style element to use to display the data in the column. The style element must be part of a style template that is registered with the Output Delivery System. SAS provides some styles. You can create customized styles with PROC TEMPLATE. For details, see DEFINE STYLE Statement. By default, ODS produces different parts of ODS output with different elements. For example, by default, a table header is displayed with the style element Header. The style elements that you would most likely use with the STYLE= attribute for a table header are as follows:
  • Header
  • HeaderFixed
  • HeaderEmpty
  • HeaderEmphasis
  • HeaderEmphasisFixed
  • HeaderStrong
  • HeaderStrongFixed
The style elements that you would most likely use with the STYLE= attribute for a footer are as follows:
  • Footer
  • FooterFixed
  • FooterEmpty
  • FooterEmphasis
  • FooterEmphasisFixed
  • FooterStrong
  • FooterStrongFixed
The style element provides the basis for displaying the header or footer. Additional style attributes that you provide can modify the display.
For more information, see Viewing the Contents of a Style.
style-element-name is either the name of a style element or a variable whose value is a style element.
style-attribute-specification
describes the style attribute to change. Each style-attribute-specification has this general form:
style-attribute-name=style-attribute-value
For information about the style attributes that you can specify, see Detailed Information for All Style Attributes.
Tips:The STYLE= attribute is valid only in the markup family, printer family, and RTF destinations.

If you use the STYLE= attribute inside a quoted string, then add a space before or after the carriage return to prevent errors. SAS does not interpret a carriage return as a space. You must explicitly specify spaces in quoted strings.