Using Prefix Options

Available Prefix Options

The following prefix options are available on ENTRY, ENTRYTITLE, and ENTRYFOOTNOTE statements:
HALIGN
Specifies the horizontal alignment of a text-item.
TEXTATTRS
Specifies font attributes for a text-item.
When used, a prefix option applies not only to immediately following piece of text but also to ALL subsequent text strings and text-commands. If the same prefix option appears more than once, each use overrides the last used prefix of the same name.

Managing Horizontal Alignment

For the ENTRY, ENTRYTITLE, and ENTRYFOOTNOTE statements, the default horizontal alignment is CENTER.
Default Horizontal Alignment is Center
entry "One" " Two" " Three" " Four" " Five" " Six"; 
To change the default alignment, you can use the HALIGN= option, which can specify LEFT, CENTER, or RIGHT alignment. The following specification left-justifies the text:
Left-justified Text
entry halign=left
 "One" " Two" " Three" " Four" " Five" " Six"; 
Text items are positionally concatenated by alignment area. For example, the following specification left-justifies the first three strings and right-justifies the last three strings:
Text Items are Positionally Concatenated by Alignment Area
entry halign=left "One" " Two" " Three"
      halign=right "Four" " Five" " Six";
Even if the HALIGN= specifications are jumbled, the final text is nevertheless positionally concatenated by alignment area:
HALIGN= Setting Determines Text Alignment
entry halign=right "Five" halign=left "One"
      halign=right " Six" halign=center "Three"
      halign=left " Two"  halign=center " Four";
When long strings are used or the bounding container is constrained, the alignment areas might overlap.

Managing Font Attributes

For the ENTRY, ENTRYTITLE, and ENTRYFOOTNOTE statements, the default font attributes are determined by the active ODS style. To change the default font attributes, you can use the TEXTATTRS= option, which has the following syntax (see General Syntax for Attribute Options for the syntax on using a style-element and Text Options for available text-options):
TEXTATTRS=style-element | style-element(text-options) | (text-options)
For example, the following ENTRYTITLE statement uses prefix options to create this title line:
Result of Using Prefix Options
entrytitle textattrs=(color=black) "Center"
  textattrs=(color=red) " Text"
  halign=right textattrs=(color=black size=10pt) "Right "
    textattrs=(color=red size=10pt) "side"
  halign=left
    textattrs=(color=black style=italic size=10pt) "Left"
    textattrs=(color=red style=italic size=10pt) " side";
  • The TEXTATTRS= options are reset each time a new TEXTATTRS= appears—there is no “carry over” or accumulation of the settings.
  • Blanks (spaces) must be provided as needed to achieve the desired concatenation. If you are concatenating dynamics that are stripped of leading and trailing blanks, you might need to introduce a literal space to separate them, as shown in the following example:
            entry _DYN1 " " _DYN2; 
Alternatively, you can specify font attributes by overriding style element defaults. The following specification overrides the settings of the GraphTitleText style element, which sets the default attributes for ENTRYTITLE text:
entrytitle
halign=left
 textattrs=GraphTitleText(color=black style=italic) "Left"
 textattrs=GraphTitleText(color=red style=italic) " side"
halign=center
 textattrs=(color=black) "Center"
 textattrs=(color=red) " Text"
halign=right
 textattrs=GraphTitleText(color=black weight=bold) "Right "
 textattrs=GraphTitleText(color=red weight=bold) "side" ;
You can also use dynamics in the text-items. In the following ENTRYTITLE statement, assume that _DEPLABEL and _MODELLABEL are dynamics that are specified on PROC TEMPLATE’s DYNAMIC statement:
entrytitle "Residual by Predicted for " _DEPLABEL
  halign=left textattrs=GraphTitleText _MODELLABEL /
   pad=(bottom=5);
  • The default style element for ENTRYTITLE is GraphTitleText, so all three text items (one literal and two dynamics) get these font properties as a starting point.
  • The text "Residual by Predicted for " _DEPLABEL is center-aligned by default.
  • The prefix options HALIGN= and TEXTATTRS= override the center alignment and font properties for the text _MODELLABEL.
Notice that this could have been coded as follows:
entrytitle halign=left
  textattrs=GraphTitleText _MODELLABEL
  halign=center textattrs=()
    "Residual by Predicted for " _DEPLABEL;
In this example, the second HALIGN= and TEXTATTRS=() were necessary to reset alignment and font properties to their defaults.
Note that the string length of the resolved dynamic _MODELLABEL does not affect the placement of the center-aligned text.