REPORT Procedure

CALL DEFINE Statement

Sets the value of an attribute for a particular column in the current row. The CALL DEFINE statement is often used to write report definitions that other people will use in an interactive report window environment. Only the FORMAT, URL, URLBP, and URLP attributes have an effect in the nonwindowing environment. In fact, URL, URLBP, and URLP are effective only in the nonwindowing environment. The STYLE= and URL attributes are effective only when you are using the Output Delivery System to create HTML, RTF, or Printer output.
Restriction: Valid only in a compute block that is attached to a report item.
Consolidating Multiple Observations into One Row of a Report

Specifying Style Elements for ODS Output in Multiple Statements

Syntax

CALL DEFINE (column-id | _ROW_ , 'attribute-name', value);

Required Arguments

column-id
specifies a column name or a column number (that is, the position of the column from the left edge of the report). A column ID can be one of the following:
  • a character literal (in quotation marks) that is the column name
  • a character expression that resolves to the column name
  • a numeric literal that is the column number
  • a numeric expression that resolves to the column number
  • a name of the form '_Cn_', where n is the column number
  • the automatic variable _COL_, which identifies the column that contains the report item that the compute block is attached to
attribute-name
is the attribute to define. For attribute names, refer to Attribute Descriptions.
Note: The attributes BLINK, HIGHLIGHT, and RVSVIDEO do not work on all devices.
Attribute Descriptions
Attribute
Description
Values
Affects
BLINK
Controls blinking of current value
1 turns blinking on; 0 turns it off
Interactive report window environment
COLOR
Controls the color of the current value in the REPORT window
'blue', 'red', 'pink', 'green', 'cyan', 'yellow', 'white', 'orange', 'black', 'magenta', 'gray', 'brown'
Interactive report window environment
COMMAND
Specifies that a series of commands follows
A quoted string of SAS commands to submit to the command line
Interactive report window environment
FORMAT
Specifies a format for the column
A SAS format or a user-defined format
Interactive report window and nonwindowing environments
HIGHLIGHT
Controls highlighting of the current value
1 turns highlighting on; 0 turns it off
Interactive report window environment
RVSVIDEO
Controls display of the current value
1 turns reverse video on; 0 turns it off
Interactive report window environment
URL
Makes the contents of each cell of the column a link to the specified Uniform Resource Locator (URL)
A quoted URL (either single or double quotation marks can be used)
HTML, RTF, and PDF output
URLBP
Makes the contents of each cell of the column a link. The link points to a Uniform Resource Locator that is a concatenation of
  1. the string that is specified by the BASE= option in the ODS HTML statement
  2. the string that is specified by the PATH= option in the ODS HTML statement
  3. the value of the URLBP attribute 1
A quoted URL (either single or double quotation marks can be used)
HTML output
URLP
Makes the contents of each cell of the column a link. The link points to a Uniform Resource Locator that is a concatenation of
  1. the string that is specified by the PATH= option in the ODS HTML statement
  2. the value of the URLP attribute 1
A quoted URL (either single or double quotation marks can be used)
HTML output
1For information about the BASE= and PATH= options, see the documentation for the ODS HTML Statement in SAS Output Delivery System: User's Guide.
_ROW_
is an automatic variable that indicates the entire current row.
value
sets the value for the attribute. For values for each attribute, refer to the following table.

Details

Using the STYLE Attribute

The STYLE attribute specifies the style element to use in the cells that are affected by the CALL DEFINE statement.
The STYLE= value functions like the STYLE= option in other statements in PROC REPORT. However, instead of acting as an option in a statement, it becomes the value for the STYLE attribute. For example, the following CALL DEFINE statement sets the background color to yellow and the font size to 7 for the specified column:
 call define(_col_, "style",
             "style=[backgroundcolor=yellow fontsize=7]");
In SAS 9.2, the STYLE and STYLE/REPLACE attributes specify the style element to be used for the Output Delivery System. If a style already exists for this cell or row, these STYLE attributes tell CALL DEFINE to replace the style specified by the STYLE= value. The STYLE/MERGE attribute tells CALL DEFINE to merge the style specified by the STYLE= value with the existing style attributes that are in the same cell or row. If there is no previously existing STYLE= value to merge, STYLE/MERGE acts the same as the STYLE or STYLE/REPLACE attributes. See Using Style Elements in PROC REPORT for more details.
Restriction: This option affects only the HTML, RTF, Printer destinations.
Interaction: If you set a style element for the CALLDEF location in the PROC REPORT statement and you want to use that exact style element in a CALL DEFINE statement, then use an empty string as the value for the STYLE attribute, as shown here:
call define (_col_, "STYLE", "" );
Tip: FONT names that contain characters other than letters or underscores must be enclosed in quotation marks.