Assignment Statement


Evaluates an expression and stores the result in a variable

Valid: in a DATA step

Category: Action

Type: Executable

Syntax

variable = expression ;

Arguments

variable

  • names a new or existing variable.

  • Range: Variable can be a variable name , array reference, or SUBSTR function.

  • Tip: Variables that are created by the Assignment statement are not automatically retained.

expression

  • is any SAS expression.

  • Tip: expression can contain the variable that is used on the left side of the equal sign. When a variable appears on both sides of a statement, the original value on the right side is used to evaluate the expression, and the result is stored in the variable on the left side of the equal sign. For more information, see 'Expressions' in SAS Language Reference: Concepts .

Details

Assignment statements evaluate the expression on the right side of the equal sign and store the result in the variable that is specified on the left side of the equal sign.

Examples

These assignment statements use different kinds of expressions:

  • name='Amanda Jones';

  • WholeName='Ms. 'name;

  • a=a+b;

See Also

Statement:

  • 'Sum Statement' on page 1406




SAS 9.1 Language Reference Dictionary, Volumes 1, 2 and 3
SAS 9.1 Language Reference Dictionary, Volumes 1, 2 and 3
ISBN: N/A
EAN: N/A
Year: 2004
Pages: 704

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net