DISCRETEATTRVAR Statement

DISCRETEATTRVAR Syntax

Creates a named association between an attribute map of discrete values and an input data column.
DISCRETEATTRVAR ATTRVAR=attrvar-name
VAR=data-column | expression | dynamic
ATTRMAP="attrmap-name";
For a specific example, see the Example Program.

DISCRETEATTRVAR Statement Summary

The DISCRETEATTRVAR statement creates and names an association between graphical properties that are specified in a DISCRETEATTRMAP block and a classification column that is in the data. The name that is assigned to the association in the DISCRETEATTRVAR statement is the name that plot statements must reference to use the attribute map.
Defining and using a discrete attribute map requires you to coordinate settings on several statements. For more information, see the DISCRETEATTRMAP statement’s Statement Summary.
The DISCRETEATTRVAR statement must be located within the BEGINGRAPH block but outside of the outermost layout block. It cannot be nested in a DISCRETEATTRMAP statement.

DISCRETEATTRVAR Statement Required Arguments

ATTRVAR= attrvar-name
specifies a SAS name for this association between the attribute map and the input column. This name must be unique within the template and can be referenced by other statements that can be associated with the attribute map. The attrvar-name should not be used in an expression. If it is, the results are unpredictable.
Note: The assigned SAS name can be the same as the name of the data input column, but it is not recommended. If an assigned attrvar-name matches the name of an input data column, the attrvar-name takes precedence.
Restriction. The name that is assigned in this argument is used to associate an attribute map with the discrete values in an input data column. Thus, it is not the name to reference when you want to display legend entries that are independent of the data. For that special use, a DISCRETELEGEND statement can reference the attribute map directly by the name that is assigned in the DISCRETEATTRMAP statement. For more information, see the DISCRETEATTRMAP statement’s Statement Summary.
VAR= data-column | expression | dynamic
specifies an input data column to be associated with an attribute map at run time. If an expression is used, a new column of transformed values is created and then matched with the attribute map.
Interaction. If the column is not found or the column is of the wrong type for the attribute map, the DISCRETEATTRVAR statement is ignored.
Tip. The input data column can be character or numeric, but the values must match the type of the values that are specified in the attribute map. For numeric columns, all values are treated as discrete values.
ATTRMAP="attrmap-name "
specifies the name of an existing discrete attribute map.
Restriction: The attrmap-name is case sensitive, must be enclosed in quotation marks, and must be the name that was assigned to the attribute map in the DISCRETEATTRMAP statement’s NAME= argument.