Previous Page | Next Page

The REPORT Procedure

CALL DEFINE Statement


Sets the value of an attribute for a particular column in the current row.
Restriction: Valid only in a compute block that is attached to a report item.
Featured in: Consolidating Multiple Observations into One Row of a Report

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

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. (See Attribute Descriptions for descriptions of the available attributes.)


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.

_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.

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*,#

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*,#

a quoted URL (either single or double quotation marks can be used) HTML output
# For information about the BASE= and PATH= options, see the documentation for the ODS HTML Statement in SAS Output Delivery System: User's Guide.

Note:   The attributes BLINK, HIGHLIGHT, and RVSVIDEO do not work on all devices.  [cautionend]


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 by quotation marks.
Featured in: Specifying Style Elements for ODS Output in Multiple Statements

Previous Page | Next Page | Top of Page