TEMPLATE Procedure: Creating Markup Language Tagsets

PUTQ Statement

Writes text, new lines, variable values, or DATA step function return values to an output file and places quotes around the value of the variable.
Modifying an Event to Include Other Style Sheets

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 PUTQ 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 PUTQ statement, if the event variable ForeGround has a value of blue, then the output is color='blue':
putq '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 PUTQ statement, if the variables BackGround, ForeGround, and CellPadding do not have values, then the output is <table> followed by a new line:

putq '<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 PUTQ 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 PUTQ statement, if the event variable ForeGround has a value of blue, then the output is color=blue:
putq '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 PUTQ statement, if the variables BackGround, ForeGround, and CellPadding do not have values, then the output is <table> followed by a new line:

putq '<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.