TEMPLATE Procedure: Creating Markup Language Tagsets

EVAL Statement

Creates or updates a user-defined variable by setting the value of the variable to the return value of a WHERE expression.

Syntax

Required Arguments

user-defined-variable
specifies the user-defined variable that you want to create or update. A user-defined-variable has one of the following forms:
  • $dictionary-variable['key']
  • $list-variable[<index>]
  • $scalar-variable
  • $$stream-variable
dictionary-variable
specifies a dictionary variable to assign a where-expression return value. A dictionary variable is an array that contains a list of numbers or text strings that are identified by a key.
['key']
specifies a subscript that contains the text that identifies where in the dictionary variable that you want to add the return value of the WHERE expression.
Requirement:Enclose key in quotation marks and brackets.
Tip:key is case preserving and case sensitive.
Requirement:dictionary-variable must be preceded by the “$” symbol.
Tip:After you create dictionary variables, they are globally available in all events until you delete them with the UNSET Statement .
See:For more information, see Understanding Variables.
list-variable
specifies a list variable to which to assign a where-expression return value. A list variable is an array that contains a list of numbers or text strings that are indexed.
[<index>]
specifies a subscript that contains a number or numeric variable.
The index identifies the location in the list to add the return value of the WHERE expression. If you omit the index and specify only empty brackets, or if the value of index is greater than the highest index number, then the EVAL statement appends the return value to the end of the list.
Requirements:Specify brackets [ ], even if you omit an index.

Enclose index in brackets.

See: For more information, see Understanding Variables.
Requirement:list-variable must be preceded by a '$' symbol.
Tips: List variables are accessed sequentially by using the ITERATE Statement and the NEXT Statement.

After you create list variables, they are globally available in all events until you use the UNSET Statement to delete them.

scalar variable
specifies a scalar variable to which to assign a where-expression return value.
Requirements:Scalar variables must be preceded by the '$' symbol.

After you create scalar variables, they are globally available in all events and persist until you use the UNSET statement to unset them.

stream-variable
specifies a stream variable to which you want to assign a where-expression return value. A stream variable is a temporary item store that contains output.
While the stream variable is open, all output from PUT statements is directed to the stream variable until it is closed.
Requirement:stream-variable must be preceded by the “$$” symbol.
See: For information about stream variables, see Understanding Variables.
where-expression
any expression that can be used in the WHERE= data set option.
See:For information about expressions that you can use in the WHERE data set option, see the WHERE= Data Set Option in SAS Data Set Options: Reference . Also see WHERE-Expression Processing in SAS Language Reference: Concepts.

Optional Argument

event-statement-condition(s)
specifies one or more conditions that must be true for the event statement to execute.
Requirement:event-statement-condition(s) must be preceded by a slash (/).
See:For information about these conditions, see Event Statement Conditions.