TEMPLATE Procedure: Creating Markup Language Tagsets

PUTL Statement

Writes text, new lines, variable values, or DATA step function return values to an output file and automatically adds a new line to the end of the output.
Tip: When the output is large, it is useful to use the PUTL statement because it adds a new line to the end of the output.

Syntax

Optional Arguments

NL
specifies a new line.
Aliases:CR

LF

text
specifies a string of text.
Requirement:text must be enclosed in quotation marks.
Interactions:The PUTL statement pairs text strings with variables. A string of text that precedes a variable creates a string-value pair if the variable has a value. For example, for the following PUTL statement, if the event variable ForeGround has a value of blue, then the output is color=blue followed by a new line:
putl 'color=' foreground;

If the variable does not have a value, then the text is not written, and there is no output for the text or the variable. For example, for the following PUTL statement, if the variables BackGround, ForeGround, and CellPadding do not have values, then the output is <table> followed by two new lines:

putl '<table' 'background=' background 'foreground=' foreground
     'cellpadding=' cellpadding '>' nl;

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.
Interactions:The PUTL statement pairs strings with variables. A string of text that precedes a variable creates a string-value pair if the variable has a value. For example, for the following PUTL statement, if the event variable ForeGround has a value of blue, then the output is color=blue followed by a new line:
putl 'color=' foreground;

If the variable does not have a value, then the text is not written, and there is no output for the text or the variable. For example, for the following PUTL statement, if the variables BackGround, ForeGround, and CellPadding do not have values, then the output is <table> followed by two new lines: one that is specified and the other that is generated automatically:

putl '<table' 'background=' background 'foreground=' foreground
     'cellpadding=' cellpadding '>' nl;

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.

Event Variables for a list of 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.