logo Getting Started with SAS Main menuGlossaryBackNext
    

Overview

Often, when you work with data sets, it's useful to create completely new variables or new variables that are based on the values of existing variables. These new variables can contain the results of SAS functions, conditionally-assigned values, or running totals of other variable values.

Creating and redefining variables

You can create variables in a DATA step in the following ways:

  • by using an assignment statement
  • by reading data with the INPUT statement in a DATA step
  • by specifying a new variable in a FORMAT or INFORMAT statement
  • by specifying a new variable in a LENGTH statement
  • by specifying a new variable in an ATTRIB statement.

When you create variables using assignment statements, you can take advantage of SAS functions and SAS expressions.



Main menuGlossaryBackNext