Table 4.2 Index Type Attribute Values
NONE The variable is not indexed.
SIMPLE The variable is part of a simple index.
COMPOSITE The variable is part of one or more composite indexes.
BOTH The variable is part of both simple and composite indexes.
is a user-defined attribute that is created using the XATTR ADD VAR statement in
the DATASETS procedure. For more information, see “Extended Attributes” in Base
SAS Procedures Guide.
Ways to Create Variables
These are some of the most common ways that you can create variables in a DATA step:
• Use an assignment statement.
• Read data with the INPUT statement in a DATA step.
• Specify a new variable in a FORMAT or INFORMAT statement.
• Specify a new variable in a LENGTH statement.
• Specify a new variable in an ATTRIB statement.
Note: This list is not exhaustive. For example, the SET, MERGE, MODIFY, and
UPDATE statements can also create variables.
Using an Assignment Statement
In a DATA step, you can create a new variable and assign it a value by using it for the
first time on the left side of an assignment statement. If a variable is created using an
assignment statement, both its type and length must be implicitely defined by SAS.
SAS determines the length and type of the variable from its first occurrence in the DATA
step. The variable gets the same type and length as the expression on the right side of the
When the type and length of a variable are not explicitly set, SAS gives the variable a
default type and length, as shown in the examples in the following table.
Ways to Create Variables 41