The DOCUMENT Procedure |
You can customize labels, titles, and footnotes with these statements by inserting BY variable values (#BYVAL), BY variable names (#BYVAR), or BY lines (#BYLINE) in labels that are specified in the following PROC DOCUMENT statements:
Note: The #BYVAL, #BYVAR, and #BYLINE substitutions only show up for replayed output objects that belong to a BY group. Examples of output objects that do not belong to a BY group are data sets that are imported into a document with the IMPORT TO statement, and notes that are created with the NOTES statement.
To create these substitutions, embed the items in the specified object text string at the position where you want the substitution text to appear. The #BYVAL, #BYVAR, and #BYLINE substitutions have this form:
substitutes the current value of the specified BY variable for #BYVAL in the text string and displays the value in the label.
Follow these rules when you use #BYVAL in a statement of a PROC DOCUMENT step:
Specify the variable that is used by #BYVAL in the BY statement.
Insert #BYVAL in the specified text string at the position where you want the substitution text to appear.
Follow #BYVAL with a delimiting character, either a space or other nonalphanumeric character (for example, a quotation mark) that ends the text string.
To immediately follow the #BYVAL substitution with other text and no delimiter, use a trailing dot (as with macro variables).
Specify the variable with one of the following:
specifies which variable in the BY statement that #BYVAL should use. The value of n indicates the position of the variable in the BY statement.
Example: | #BYVAL2 specifies the second variable in the BY statement. |
Example: | #BYVAL(YEAR) specifies the BY variable, YEAR. |
Tip: | variable-name is not case sensitive. |
Requirement: | You must enclose variable-name in parentheses. |
substitutes the name of the BY variable or label that is associated with the variable (whatever the BY line would normally display) for #BYVAR in the text string and displays the name or label.
Follow these rules when you use #BYVAR in a statement of a PROC DOCUMENT step:
Specify the variable that is used by #BYVAR in the BY statement.
Insert #BYVAR in the specified text string at the position where you want the substitution text to appear.
Follow #BYVAR with a delimiting character, either a space or other nonalphanumeric character (for example, a quotation mark) that ends the text string.
To immediately follow the #BYVAR substitution with other text and no delimiter, use a trailing dot (as with macro variables).
Specify the variable with one of the following:
specifies the variable in the BY statement that #BYVAR should use. The value of n indicates the position of the variable in the BY statement.
Example: | #BYVAR2 specifies the second variable in the BY statement. |
Example: | #BYVAR(SITES) specifies the BY variable SITES. |
Tip: | variable-name is not case sensitive. |
Requirement: | You must enclose variable-name in parentheses. |
substitutes the entire BY line without leading or trailing blanks for #BYLINE in the text string and displays the BY line in the label.
Copyright © 2008 by SAS Institute Inc., Cary, NC, USA. All rights reserved.