TEMPLATE Procedure: Creating Markup Language Tagsets

PUTVARS Statement

Iterates over each value in a variable group, list, or dictionary and writes text, new lines, variable values, or DATA step function return values to an output file. Each iteration populates the special variables _VALUE_ and __NAME_ . PUTVARS prints once for each variable or value that it finds.
Tip: The variable _NAME_ contains the name of the variable. The variable _VALUE_ contains the value of the variable.
See: _VALUE_ and _NAME_ in Data Variables.

Syntax

Required Arguments

variable-group
specifies the type of variable to use in each iteration when you specify the name or value in the variable. For example, if you specify the EVENT option, then the PUTVARS statement loops through all of the event variables in the program. variable-group is one of the following:
EVENT
specifies to loop through all event variables.
STYLE
specifies to loop through all style variables.
DYNAMIC
specifies to loop through all dynamic variables.
MEMORY
specifies to loop through all memory variables. A memory variable is classified as a dictionary variable if it is created with a subscript that contains a key. A memory variable is classified as a list variable if it is created with a subscript that is empty or contains an index. If you omit a key or an index, then the memory variable is a numeric or character scalar variable, depending on the variable's value.
Restriction:The PUTVARS statement ignores list or dictionary memory variables.
STREAM
specifies to loop through all stream variables.
Interaction:The PUTVARS statement pairs text strings with variables. If a string is followed by a variable, then they become a pair. If the variable has a value, then the pair becomes output. If the variable does not have a value, then neither becomes output.
dictionary-variable
specifies a dictionary variable.
Requirement: dictionary-variable must be preceded by the '$' symbol.
Tip:User-defined variables are not case sensitive.
See:For information about list variables, see the following sections: EVAL Statement, SET Statement, and Understanding Variables.
list-variable
specifies a list variable.
Requirement:list-variable must be preceded by the “$” symbol.
Tip:User-defined variables are not case sensitive.
See:For information about list variables, see the following sections: EVAL Statement, SET Statement, and Understanding Variables.

Optional Arguments

NL
specifies a new line.
Aliases:CR

LF

text
specifies a string of text.
Requirement:text must be enclosed in quotation marks.
value
specifies any event variable, style variable, dynamic variable, user-defined variable, or DATA step function whose value you want to output.
Restriction:DATA step functions cannot be nested.
Requirement:User-defined variables must be preceded by a '$' or '$$' character.
Tip:User-defined variables are not case sensitive.
See:For information about DATA step functions, see SAS Functions and CALL Routines: Reference.

For information about variables, see Understanding Variables.

For a list of event variables, see Event Variables.

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.