Previous Page | Next Page

TEMPLATE Procedure: Creating Markup Language Tagsets

DEFINE TAGSET Statement


Creates a tagset.
Requirement: An END statement must be the last statement in the template.

DEFINE TAGSET tagset-path | Base.Template.Tagset </ STORE=libref.template-store <(READ | WRITE | UPDATE)>>;
<tagset-attribute-1; <... tagset-attribute-n;>>
DEFINE EVENT event-name;
statements and attributes
NOTES 'text';
END;

DEFINE TAGSET Statements
Task Statement
Define what is written to the output file DEFINE EVENT
Provide information about the tagset NOTES
End a tagset, or end the editing of a tagset END


Required Arguments

tagset-path

specifies where to store the tagset.

Requirement: A tagset-path consists of one or more names, which are separated by periods. Each name represents a directory, or level, in a template store.
Default: PROC TEMPLATE writes the template to the first template store in the current path where you have Write access.
Tip: Use the ODS PATH statement to control the item store where the tagset is stored.
Tip: Names are not case sensitive. However, PROC TEMPLATE puts the first letter in uppercase for easier reading.
Base.Template.Tagset

creates a tagset that is the parent of all tagsets that do not explicitly specify a parent. Once this template is created, you do not need to explicitly specify it in your SAS programs. It is automatically applied to all output until you specifically remove it from the item store.

CAUTION:
The Base.Template.Tagset supplied by SAS contains information used by many tagsets. If this information is not retained, unexpected behavior may occur. To safely create your own Base.Template.Tagset, you can start with the existing Base.Template.Tagset template by writing it to an external file and editing the existing template contents.   [cautionend]
Interaction: The Base.Template.Tagset master template attributes are overridden by other tagsets.
Tip: To view an existing tagset to base your own Base.Template.Tagset on, see Viewing the Contents of a Tagset.

Options

STORE=libref.template-store

specifies the template store where the template is stored in the following form:

libref.template-store <access-option(s)>
libref.template-store

specifies the current template store.

Default: If you omit an access-option, then the template-store is accessed with UPDATE permissions unless you have read-only access.
Tip: If the specified template store does not exist, then it is created.
Interaction: The STORE= option overrides the search list specified in the PATH statement.
Restriction: The STORE= option syntax does not become part of the compiled template.
access-option(s)

specifies the access mode for the specified template store.

READ

provides read-only access.

WRITE

provides Write access as well as Read access. If the tagset does not exist, then WRITE access creates a new tagset. If the tagset does exist, then WRITE access does not replace an existing tagset.

UPDATE

provides Update access as well as Read access. If the tagset does not exist, then UPDATE does not create a new tagset. If the tagset does exist, then UPDATE will replace it.


Tagset Attributes

Tagset Attributes by Task
Task Attribute
Specify the maximum number of characters that will be considered for forced line breaks by ODS BREAKTEXT_LENGTH=
Specify the maximum ratio of the width of space available for text entry to the length of the text that is supposed to fit in that space BREAKTEXT_RATIO=
Specify the maximum width of space available for text entry that ODS will consider for placement of automatic line breaks BREAKTEXT_WIDTH=
Specify the text to use as a copyright COPYRIGHT=
Specify the name of the event to use by default DEFAULT_EVENT=
Specify whether the tagset supports embedded stylesheets EMBEDDED_STYLESHEET=
Specify a comma-delimited list of image types or file extensions that are valid for an output destination IMAGE_FORMATS=
Specify the number of spaces the NDENT and XDENT event statements will indent the output INDENT=
Specify a string, which is printed to the SAS log when the tagset is used LOG_NOTE=
Specify special characters and their translations MAP=
Specify strings to substitute for special characters MAPSUB=
Set a category for the output OUTPUT_TYPE=
Specify whether a byte-order mark is written to the output files when using a UTF character set NO_BYTE_ORDER_MARK=
Define a nonbreaking space for the markup output NOBREAKSPACE=
Specify the tagset from which the current template inherits PARENT=
Specify whether all style attributes are available at all times PURE_STYLE=
Specify the text to use as a registered trademark REGISTERED_TM=
Define a string to use for line breaks in the markup output SPLIT=
Specify whether the tagset lets procedures place columns on top of each other, or side by side STACKED_COLUMNS=
Specify the text to use as a trademark TRADEMARK=

BREAKTEXT_LENGTH=number

specifies the maximum number of characters that will be considered for forced line breaks by ODS. When the number of characters in the text exceeds the number specified by the BREAKTEXT_LENGTH= option, then line breaks are inserted by the application that displays the output. If the number of characters in the text is less than or equal to the number specified by the BREAKTEXT_LENGTH= option, then any necessary line breaks are inserted by ODS. The placement of the line breaks is based upon the total available text width.

Example: To instruct ODS to not insert line breaks in text that is longer than 80 characters, specify the following:
BreakText_Length=80; 
BREAKTEXT_RATIO=number

specifies the maximum ratio of the width of space available for text entry to the length of the text that is supposed to fit in that space. If the ratio of width space to text length is greater than the ratio specified by the BREAKTEXT_RATIO= option, then any necessary line breaks are inserted by the application that displays the output. If the ratio of width space to text length is equal to or less then the ratio specified by the BREAKTEXT_RATIO= option, then any necessary line breaks are inserted by ODS.

Example: To not insert line breaks into text that is more than 1.5 times longer than the width of space it is to fit in, specify the following:
BreakText_Ratio=1.5;
BREAKTEXT_WIDTH=number

specifies the maximum width of space available for text entry that ODS will consider for placement of automatic line breaks. If the width of space is greater than the number specified by the BREAKTEXT_WIDTH= option, then any necessary line breaks are inserted by the application that displays the output. If the width of space is less than or equal to the number specified by the BREAKTEXT_WIDTH= option, then ODS inserts necessary line breaks.

Example: To instruct ODS to not insert line breaks in text that is going into a space greater than or equal to 40 characters wide, specify the following:
BreakText_Width=40; 
COPYRIGHT= '(text)'

specifies the text to use as the copyright.

Requirement: When specifying text, enclose the text in parentheses and then quotation marks.
DEFAULT_EVENT= 'event-name'

specifies the name of an event to execute by default when the requested event cannot be found in the tagset.

Requirement: When specifying an event-name, enclose the name of the event in quotation marks.
Featured in: Creating a New Tagset
EMBEDDED_STYLESHEET= YES | ON | NO | OFF

specifies whether or not the tagset supports embedded stylesheets.

Default: The default value is YES or ON, which means that embedded stylesheets are supported.
Tip: If embedded stylesheets are supported and you do not specify a stylesheet in the ODS statement, then the stylesheet is written to the top of the output file.
YES

supports embedded stylesheets.

Alias: ON
ON

supports embedded stylesheets.

Alias: YES
NO

does not support embedded stylesheets.

Alias: OFF
OFF

does not support embedded stylesheets.

Alias: NO
IMAGE_FORMATS= 'image-type(s)'

specifies a comma-delimited list of image types or file extensions that are valid for an output destination. The image types can be any that are supported by SAS/GRAPH. List them in order of preference.

Example: The following IMAGE_FORMATS= statement lists valid image types for the HTML destination:
image_formats='gif,jpeg,png'; 
INDENT=n

specifies how many spaces the NDENT and XDENT event statements will indent the output.

n

specifies a numeric value for the number of spaces that you want the output to indent.

Default: 0
Tip: The INDENT= attribute is valid only in markup family destinations.
Featured in: Creating a New Tagset and Indenting Output
LOG_NOTE= 'string'

defines a string that is printed to the SAS log when the tagset is used.

string

specifies the text that is printed to the SAS log.

Requirement: Specify only one string at a time.
MAP= 'characters'

specifies the special characters that require translation.

characters

specifies one or more special characters.

Requirement: When listing special characters in the MAP= statement, omit blank spaces between them.
Requirement: When you specify special characters, enclose the list of special characters in quotation marks.
Requirement: Use the MAP= statement with the MAPSUB statement.
Featured in: Creating a New Tagset
MAPSUB= 'strings'

specifies the text to substitute for the characters that are specified in the MAP= statement.

strings

Specifies the text strings to substitute for the characters that are specified in the MAP= statement.

Requirement: When specifying multiple strings, use a forward slash (/) to separate the text strings.
Requirement: When specifying strings, enclose the entire string list in quotation marks.
Requirement: Use the MAPSUB= statement with the MAP= statement.
Featured in: Creating a New Tagset
NOBREAKSPACE= 'string'

defines a nonbreaking space for the markup output.

string

specifies the character that defines a nonbreaking space.

Requirement: When specifying a string, enclose the string in quotation marks.
Restriction: Specify only one string at a time.
Featured in: Creating a New Tagset
NO_BYTE_ORDER_MARK=YES | ON | NO | OFF

specifies whether or not a byte-order mark is written to the output files when using a UTF character set.

OUTPUT_TYPE= CSV | HTML | LATEX | WML | XML

sets a category for the output.

CSV

produces output with comma-separated values.

HTML

produces Hypertext Markup Language output.

LATEX

produces output in LaTeX, which is a document preparation system for high-quality typesetting.

WML

uses the Wireless Application Protocol (WAP) to produce a wireless markup language.

XML

produces output in Extensible Markup Language.

Featured in: Creating a New Tagset
PARENT= tagset-path

specifies the tagset from which the current template inherits.

tagset-path

specifies the name of a directory in a template store.

Default: The current template inherits from the specified template in the first template store where you have Read access. The PATH statement specifies which locations to search for templates that were created by PROC TEMPLATE, as well as the order in which to search for them.
Interaction: When you specify a parent, all of the template options, attributes, and statements that are specified in the parent's template are used in the current template, unless the current template overrides them.
Requirement: When you specify a parent, all of the template options, attributes, and statements that are specified in the parent's template are used in the current template, unless the current template overrides them.
Tip: Specify a tagset that SAS supplies or a customized tagset.
Tip: Control the item store from which the tagset is read by using the ODS PATH statement.
Featured in: Creating a Tagset through Inheritance and Using the STACKED_COLUMNS Attribute in a Tagset
PURE_STYLE=YES | ON | NO | OFF

specifies whether all of the style attributes are available at all times.

REGISTERED_TM= '(text)'

specifies the text to use as the registered trademark.

Requirement: When specifying text, enclose the text in parentheses and then quotation marks.
SPLIT= 'string'

defines a text string to use for line breaks in the markup output.

Requirement: When specifying a string, enclose the string in quotation marks.
Restriction: Specify one string at a time.
Featured in: Creating a New Tagset
STACKED_COLUMNS= YES | ON | NO | OFF

specifies whether or not the tagset lets procedures stack columns on top of each other, or place them side by side.

Default: The default value is YES or ON, which means that columns are stacked.
Tip: To place columns side by side, specify the NO or OFF value.
Featured in: Creating a New Tagset and Using the STACKED_COLUMNS Attribute in a Tagset
YES

stacks columns on top of each other.

Alias: ON
ON

stacks columns on top of each other.

Alias: YES
NO

stacks columns side by side.

Alias: OFF
OFF

stacks columns side by side.

Alias: NO
TRADEMARK= '(text)'

specifies the text to use as the trademark.

Requirement: When specifying text, enclose the text in parentheses and then quotation marks.

DEFINE EVENT Statement


Defines what is written to the output file.
Interaction: You can add event statement conditions to any DEFINE EVENT statement. For more information about event statement conditions, see Event Statement Conditions.
Featured in: Using Different Styles for Events and Modifying an Event to Include Other Stylesheets

DEFINE EVENT event-name;
<event-attribute-1;<...event-attribute-n;>>
BLOCK event-name < / event-statement-condition(s)>;
BREAK </ event-statement-condition(s)>;
CLOSE </ event-statement-condition(s)>;
CONTINUE </ event-statement-condition(s)>;
DELSTREAM $$stream-variable-name </ event-statement-condition(s)>;
DO </ event-statement-condition(s)>;
DONE;
ELSE </ event-statement-condition(s)>;
EVAL $<$>user-defined-variable-name user-defined-variable-value where-expression </event-statement-condition(s)>;
FLUSH </event-statement-condition(s)>;
ITERATE $dictionary-variable | $list-variable</ event-statement-condition(s)>;
NDENT </ event-statement-condition(s)>;
NEXT $dictionary-variable | $list-variable </ event-statement-condition(s)>;
OPEN $$stream-variable-name </ event-statement-condition(s)>;
PUT <function> <NL> <variable> <'text' > < / event-statement-condition(s)>;
PUTL (<variable> | <'text' >| <function> | <NL>) < / event-statement-condition(s)>;
PUTLOG (<variable> <'text' > <function>)</ event-statement-condition(s)>;
PUTQ(<variable> | <'text' >| <function> | <NL>)</ event-statement-condition(s)>;
PUTSTREAM $$stream-variable-name </ event-statement-condition(s)>;
PUTVARS variable-group variable-group-value< / event-statement-condition(s)>;
SET $<$>user-defined-variable-name user-defined-variable-value</ event-statement-condition(s)>;
STOP </ event-statement-condition(s)>;
TRIGGER event-name <START | FINISH> </ event-statement-condition(s)>;
UNBLOCK event-name </ event-statement-condition(s)>;
UNSETALL | $memory-variable | $$stream-variable</ event-statement-condition(s)>;
XDENT </ event-statement-condition(s)>;
END;

DEFINE EVENT Statements
Task Statement
Add a condition to any DEFINE EVENT statement Event Statement condition(s)
Set one or more event attributes event-attributes
Disable the specified event BLOCK
Prevent an event from executing BREAK
Close the current stream variable to which all PUT statement variables are directed CLOSE
Specify that the execution of the DO loop returns to the corresponding DO statement CONTINUE
Delete the specified stream variable DELSTREAM
Begin a statement block that executes if the required condition is true DO
End a statement block DONE
Begin a statement block that executes if the corresponding DO statement is false ELSE
Create or update a user-defined variable and its value EVAL
Write buffered output to the current output file or stream variable FLUSH
Specify a dictionary variable or list variable to loop through, and for each iteration, assign the variable's values to the _NAME_ and _VALUE_ event variables ITERATE
Indent output one more indentation level NDENT
Increment a dictionary or list variable to the next value NEXT
Open or create a stream variable OPEN
Write text or variable data to an output file PUT
Write text or variable values to an output file and add a new line to the end of the output PUTL
Write the text or the value of a variable to the log PUTLOG
Write text or variable values to an output file and place quotes around the value of a variable PUTQ
Write the contents of a stream variable to the output file PUTSTREAM
Write the name or the value of a variable to an output file PUTVARS
Create or update a user-defined variable and its value SET
Move execution to the end of the current statement block STOP
Execute an event TRIGGER
Enable a disabled event UNBLOCK
Delete user-defined variables UNSET
Indent output one less indentation level XDENT
End the template END


Required Arguments

event-name

specifies the name of the event.

event-attribute

specifies an event attribute statement. Event attribute statements are one of the following:

Event Attributes
Task Attribute Valid Destinations
Redirect event output to any of the known types of output that are open FILE= HTML, MARKUP
Enable the event to use any style element that has been defined PURE_STYLE= MARKUP
Specify a style element STYLE= HTML, MARKUP

FILE= BODY | CODE | CONTENTS | DATA | FRAME | PAGES | STYLESHEET;

redirects event output to any of the known types of output files that are open.

Restriction: The FILE= attribute is valid only in markup family destinations.
Interaction: The names of the output files correspond to the output file names on the ODS MARKUP statement that are specified with the BODY=, CODE=, CONTENTS=, FRAME=, PAGES=, and STYLESHEET= options. For more information about these options, see the ODS MARKUP Statement.
See: The BODY= option in the ODS MARKUP Statement for a complete description of the FILE= attribute
PURE_STYLE= YES | NO;

specifies whether to enable the event to use any of the style elements that have been defined.

Default: NO
Restriction: The PURE_STYLE= attribute is valid only in markup family destinations.
See also: DEFINE STYLE Statement
YES

enables the event to use any of the style elements that have been defined.

Alias: ON
NO

does not enable the event to use any of the style elements that have been defined.

Alias: OFF
STYLE= style-element;

specifies a style attribute that applies to a particular part of the output.

Restriction: The STYLE= attribute is valid only in markup family destinations.
Tip: When a carriage return separates style attributes, add a space before or after the carriage return to prevent syntax errors. SAS does not interpret a carriage return as a space.
See also: DEFINE STYLE Statement
Featured in: Using Different Styles for Events

BLOCK Statement


Disables the specified event.
Tip: To enable the blocked event, use the UNBLOCK statement.
Tip: You can block the same event multiple times, but to enable the event, use the same number of UNBLOCK statements.

BLOCK event </ event-statement-condition(s)>;


Required Arguments

event

specifies the event.


Options

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: Event Statement Conditions for information about these conditions

BREAK Statement


Stops the current event from executing. Statements below the BREAK statement are not executed.
Tip: The BREAK statement is most useful when combined with event statement conditions.

BREAK < / event-statement-condition(s)>;


Options

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: Event Statement Conditions for information about these conditions


CLOSE Statement


Closes the current stream variable and directs all future output to the output file.
CLOSE < / event-statement-condition(s)>;


Options

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: Event Statement Conditions for information about these conditions

CONTINUE Statement


Specifies that the execution of the DO loop returns to the corresponding DO statement for re-evaluation of the IF event statement condition.
See also: DO Statement

CONTINUE </ event-statement-condition(s)>;


Options

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: Event Statement Conditions for information about these conditions

DELSTREAM Statement


Deletes the specified stream variable.
DELSTREAM stream-variable < / event-statement-condition(s)>;


Required Arguments

stream-variable

specifies the stream variable to be deleted.

See also: OPEN Statement

Options

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: Event Statement Conditions for information about these conditions

DO Statement


Begins a statement block that executes if the required condition is true.
DO / event-statement-condition(s);


Required Arguments

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: Event Statement Conditions for information about these conditions

DONE Statement


Ends a DO or ELSE statement block.
See also: DO Statement and ELSE Statement

DONE;



ELSE Statement


Begins a statement block that executes if the corresponding DO statement is false.
Tip: If you specify the ELSE statement with the DO statement and the WHILE condition, then the ELSE statement executes only if the WHILE condition is false on the first evaluation.
See also: DO Statement

ELSE </ event-statement-condition(s)>;


Options

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: Event Statement Conditions for information about these conditions

END Statement


Ends the event.
END;


EVAL Statement


Creates or updates a user-defined variable by setting the value of the variable to the return value of a WHERE expression.
EVAL $<$>user-defined-variable where-expression< / event-statement-condition(s)>;


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 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 use the UNSET statement to delete them.
See also: Dictionary variable for more information
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.

Requirement: Specify brackets [ ], even if you omit an index.
Requirement: Enclose index in brackets.
See also: List variable for more information
Requirement: list-variable must be preceded by a '$' symbol.
Tip: List variables are accessed sequentially by using the ITERATE and NEXT statements.
Tip: 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.

Requirement: Scalar variables must be preceded by the '$' symbol.
Requirement: 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 also: Understanding Variables for information about stream variables
where-expression

any expression that can be used in the WHERE= data set option.

See: For information on expressions that you can use in the WHERE data set option, see the WHERE= data set option in SAS Language Reference: Dictionary and "WHERE Expression Processing" in SAS Language Reference: Concepts.

Options

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: Event Statement Conditions for information about these conditions

Event Statement Conditions


Specify one or more conditions that must be true for a DEFINE EVENT statement to execute.
Requirement: An event statement condition must be preceded with a slash (/).

define-event-statement </ event-statement-condition(s)>;

Event Statement Conditions

define-event-statement

specifies a DEFINE EVENT statement.

event-statement-condition

specifies a condition to evaluate.

event-statement-condition is one of the following:

ANY (variable-1,< ..., variable-n>)

checks a list of comma-delimited variables for values. If any of the variables has a value, then the condition is true.

Example:
put 'One of our variables has a value!' 
   nl/if any(background, foreground, cellpadding, cellspacing);  
BREAKIF event

stops an event that is executing. The current statement is executed and the event ends.

Tip: Using the BREAKIF condition is more efficient than using a PUT event statement and a BREAK event statement with an IF condition together. For example, the following statements are equivalent:
put 'Foreground has a value!' /breakif exists(foreground); 
put 'Foreground has a value!' /if exists(foreground);
break /if exists(foreground); 
CMP ("string", variable | variable-list)

compares, for equality, a string to a variable or list of variables.

Example:
 put 'The foreground is blue!' nl/if cmp('blue',foreground);
CONTAINS (argument-1, argument-2)

searches the first argument for the second argument.

Example:
set $myvariable 'some random text';
put 'myvariable contains 'ran' nl/if contains($myvariable, 'ran'); 
EXIST | EXISTS (variable | variable-list)

determines whether a variable or a list of variables has values. If all of the variables have values, then the condition is true. If a variable has an empty string of length 0, then the variable has no value and the condition is false.

Tip: Use the MISSING event variable with the EXIST condition to determine whether a value is missing.
Example:
put 'All of our variables have a value!' 
   nl/if exists(background, foreground, cellpadding, cellspacing); 
IF | WHEN | WHERE(<value><'string'><variable>)

tests for existence or equality. IF, WHEN, and WHERE are optional and interchangeable. An IF, a WHEN, or a WHERE condition compares values and strings, or checks variables for values.

Example: All of the following are equivalent:
put 'Foreground has a value!' nl/if (foreground);
put 'Foreground has a value!' nl/if exists(foreground);
put 'Foreground has a value!' nl/when exists(foreground);
put 'Foreground has a value!' nl/exists(foreground);
put 'Foreground has a value!' nl/where existsforeground);
Restriction: When you specify an IF condition with a single, user-defined variable, then the variable is evaluated to determine if it has a value, according to the variable's type.
Variable Type and Criteria
Variable Type Criteria to Determine Existence
String Length
Numeric Value
Dictionary array Key (if there is a key specified, then the test is true)

NOT | ! | ^ <'string'><variable>

negates a condition. You can use the keyword NOT or the characters '!' or '^'.

Restriction: The character '!' works only as the first character in a condition. The standard WHERE processing syntax is required for subsequent characters.
Example:
put 'The foreground is not red!' nl/if not cmp('red', foreground);
put 'The foreground is not red or blue' /if !cmp('red', foreground) 
     and ^cmp('blue', foreground);
put 'The foreground is not red or blue' /if ^cmp('red', foreground) 
     and ^cmp('blue', foreground);
WHILE condition-expression

indicates that the corresponding statement block should loop until the WHILE value becomes false.

Restriction: The WHILE condition can be used only with the DO statement.
Example:
eval $count 0;

do /while $count < 10;
    eval $i $count+1;
    continue /if $count eq 5;
    stop /if $count eq 8;
    put 'Count is ' $i nl;
else;
    put 'Count was never less than 10' nl;
done;

FLUSH Statement


Writes buffered output to the current output file or the current stream variable.
FLUSH </ event-statement-condition(s)>;


Options

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: Event Statement Conditions for information about these conditions

ITERATE Statement


Specifies a dictionary variable or list variable to loop through, and assigns the variable's value to the _NAME_ and _VALUE_ event variables for each iteration.
Requirement: You must use the ITERATE statement with the _VALUE_ or _NAME_ event variables. The first value of the dictionary variable or list variable is placed in the _VALUE_ event variable. For dictionary variables, the key is placed in the _NAME_ event variable.
See also: _VALUE_ and _NAME_

ITERATE dictionary-variable | list-variable </ event-statement-condition(s)>;


Required Arguments

dictionary-variable

specifies a dictionary variable.

Requirement: dictionary-variable must be preceded by the "$" symbol.
Tip: User-defined variables are not case sensitive.
See also: The EVAL Statement or the SET Statement for information about dictionary 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 also: The EVAL Statement or the SET Statement for information about list variables

Options

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: Event Statement Conditions for information about these conditions

NDENT Statement


Indents output one more level than the number of spaces specified by the INDENT= attribute.
Interaction: The start position of the indention level is set by the INDENT= attribute.
Featured in: Creating a New Tagset and Indenting Output

NDENT < / event-statement-condition(s)>;


Options

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: Event Statement Conditions for information about these conditions

NEXT Statement


Specifies to increase a dictionary or list variable incrementally to the next value and to repopulate the event variables _VALUE_ and _NAME_ as appropriate.
Requirement: Use the NEXT statement with the ITERATE statement.
See also: _VALUE_ and _NAME_

NEXT $dictionary-variable | $list-variable </ event-statement-condition(s)>;


Required Arguments

dictionary-variable

specifies a dictionary variable that is designated as an iterator by the ITERATE statement.

Requirement: dictionary-variable must be preceded by the "$" symbol.
Tip: User-defined variables are not case sensitive.
See also: ITERATE Statement
See also: The EVAL Statement or the SET Statement for information about dictionary variables
list-variable

specifies a list variable that is designated as an iterator by the ITERATE statement.

Requirement: list-variable must be preceded by the "$" symbol.
Tip: User-defined variables are not case sensitive.
See also: ITERATE Statement
See also: The EVAL Statement or the SET Statement for information about list variables

Options

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: Event Statement Conditions for information about these conditions

OPEN Statement


Opens or creates a stream variable. When the PUT statements occur after the OPEN statement, all text or variable data that is specified by PUT statements is appended to the stream variable instead of the output file.
Interaction: An open stream variable is closed when a new stream variable is opened.

OPEN stream-variable </ event-statement-condition(s)>;


Required Arguments

stream-variable

specifies a stream variable, which is a temporary item store that contains output.

Tip: User-defined variables are not case sensitive.
Tip: If you assign the name of a memory variable to stream-variable, then the stream variable resolves as the value of the memory variable. For example, the following program uses the memory variable $MyStream as a stream variable:
set $mystream 'test';
open $mystream;
put 'The memory variable $mystream is being used as a stream variable';
close;
Therefore, the following statements are equivalent:
put $$test;
putstream $mystream;
putstream test;
The following statements are also equivalent:
unset $$test;
delstream $mystream;
delstream test;

Options

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: Event Statement Conditions for information about these conditions

PUT Statement


Writes text, new lines, variable values, or DATA step function return values to an output file.
Featured in: Creating a Tagset through Inheritance, Creating a New Tagset, Executing Events Using the TRIGGER= Statement, Indenting Output, and Using Different Styles for Events

PUT <'text'> <NL(s)> <value(s)> </ event-statement-condition(s)>;


Required Arguments

NL

specifies a new line.

Alias: CR
Alias: LF
text

specifies a string of text.

Requirement: text must be enclosed in quotation marks.
Interaction: The PUT 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 PUT statement, if the event variable ForeGround has a value of blue, then the output is color=blue:
put '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 PUT statement, if the variables BackGround, ForeGround, and CellPadding do not have values, then the output is <table> followed by a new line:

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

put '<table' 'background=' background 'foreground=' foreground 
    'cellpadding=' cellpadding '>' nl;
Tip: User-defined variables are not case sensitive.
See also: SAS Language Reference: Dictionary for information about DATA step functions
See also: Understanding Variables for information about variables
See also: Event Variables for a list of event variables

Options

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: Event Statement Conditions for information about these conditions

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.

PUTL <'text'> <NL(s)> <value(s)> </ event-statement-condition(s)>;


Required Arguments

NL

specifies a new line.

Alias: CR
Alias: LF
text

specifies a string of text.

Requirement: text must be enclosed in quotation marks.
Interaction: 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.
Interaction: 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 also: SAS Language Reference: Dictionary for information about DATA step functions
See also: Understanding Variables for information about variables
See also: Event Variables for a list of event variables

Options

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: Event Statement Conditions  for information about these conditions


PUTLOG Statement


Writes text, new lines, variable values, or DATA step function return values to the log.
Restriction: Unlike the other PUT statements, the PUTLOG statement does not specify new lines.

PUTLOG <'text'> <value(s)> </ event-statement-condition(s)>;


Required Arguments

text

specifies a string of text.

Requirement: text must be enclosed in quotation marks.
Interaction: The PUTLOG 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 PUTLOG statement, if the event variable ForeGround has a value of blue, then the output that is written to the log is color=blue:
putlog '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 PUT statement, if the variables BackGround, ForeGround, and CellPadding do not have values, then the output that is written to the log is <table>:

putlog '<table' 'background=' background 'foreground=' foreground 
    'cellpadding=' cellpadding '>';
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.
Interaction: The PUTLOG 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 PUTLOG statement, if the event variable ForeGround has a value of blue, then the output that is written to the log is color=blue:
putlog '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 PUTLOG statement, if the variables BackGround, ForeGround, and CellPadding do not have values, then the output that is written to the log is <table>:

putlog '<table' 'background=' background 'foreground=' foreground 
    'cellpadding=' cellpadding '>';
Tip: User-defined variables are not case sensitive.
See also: SAS Language Reference: Dictionary for information about DATA step functions
See also: Understanding Variables for information about variables
See also: Event Variables for a list of event variables

Options

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: Event Statement Conditions for information about these conditions

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.
Featured in: Modifying an Event to Include Other Stylesheets

PUTQ <'text'> <NL(s)> <value(s)> </ event-statement-condition(s)>;


Required Arguments

NL

specifies a new line.

Alias: CR
Alias: LF
text

specifies a string of text.

Requirement: text must be enclosed in quotation marks.
Interaction: 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.
Interaction: 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 also: SAS Language Reference: Dictionary for information about DATA step functions
See also: Understanding Variables for information about variables
See also: Event Variables for a list of event variables

Options

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: Event Statement Conditions for information about these conditions

PUTSTREAM Statement


Writes the contents of the specified stream variable to an output file.
PUTSTREAM stream-variable < / event-statement-condition(s)>;


Required Arguments

stream-variable

specifies a stream variable, which is a temporary item store that contains output.

Tip: If you assign the name of a memory variable to stream-variable-name, then the stream variable resolves as the value of the memory variable. For example, the following partial program uses the memory variable $MyStream as a stream variable:
set $mystream 'test';
open $mystream;
put 'The memory variable $mystream is being used as a stream variable';
close;
Therefore, the following statements are equivalent:
put $$test;
putstream $mystream;
putstream test;
The following statements are also equivalent:
unset $$test;
delstream $mystream;
delstream test;

Options

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: Event Statement Conditions for information about these conditions

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 also: _VALUE_ and _NAME_

PUTVARS (variable-group | dictionary-variable | list-variable) <NL(s)> <'text'> <value(s) >
< / event-statement-condition(s)>;


Required Argument

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.

See also: 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 PUTVAR 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 also: For information about list variables, see the following sections:
list-variable

specifies a list variable.

Requirement: list-variable must be preceded by the "$" symbol.
Tip: User-defined variables are not case sensitive.
See also: For information about list variables, see the following sections:
NL

specifies a new line.

Alias: CR
Alias: 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 also: SAS Language Reference: Dictionary for information about DATA step functions
See also: Understanding Variables for information about variables
See also: Event Variables for a list of event variables

Options

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: Event Statement Conditions for information about these conditions

SET Statement


Creates or updates a user-defined variable and its value.
[1] SET $dictionary-variable entry </ event-statement-condition(s)>;
[2] SET $list-variable entry </ event-statement-condition(s)>;
[3] SET $scalar-variable | $$stream-variable entry </ event-statement-condition(s)>;


Required Arguments

dictionary-variable

specifies an array that contains a list of numbers or text strings that is identified by a key. dictionary-variable has the following form:

$dictionary-variable['key']
['key']

specifies a subscript that contains text or a variable that has a character value.

Requirement: Enclose key in quotation marks and brackets.
Tip: key is case preserving and case sensitive.
Example: The following example puts two key value pairs into the dictionary variable MyDictionary:
set $mydictionary['URL1'] 'links internally';
set $mydictionary['URL2'] 'links externally';
Requirement: dictionary-variable must be preceded by the '$' symbol.
Tip: Dictionary variables are accessed sequentially by using the ITERATE and NEXT statements.
Tip: After they are created, dictionary variables are globally available in all events until you delete them by using the UNSET statement.
entry

specifies the value of a dictionary variable, list variable, scalar variable, or stream-variable. An entry is one of the following:

function

specifies a DATA step function.

Restriction: Functions cannot be nested.
See also: SAS Language Reference: Dictionary for information on SAS functions
text

specifies a string of text.

Requirement: text must be enclosed in quotation marks.
variable

specifies any event variable, style variable, dynamic variable, user-defined variable, or DATA step function whose value you want to output.

Restriction: variable cannot be a stream variable.
Requirement: User-defined variables must be preceded by a '$' character.
Tip: If you assign a variable entry that is the name of a memory variable to stream-variable, then the stream variable resolves as the value of the memory variable. For example, the following program uses the memory variable $MyStream as a stream variable:
set $mystream 'test';
open $mystream;
put 'The memory variable $mystream is being used as a stream variable';
close;
Therefore, the following statements are equivalent:
put $$test;
putstream $mystream;
putstream test;
The following statements are also equivalent:
unset $$test;
delstream $mystream;
delstream test;
Tip: User-defined variables are not case sensitive.
See also: Understanding Variables for information about variables
See also: Event Variables for a list of event variables
list-variable

an array that contains a list of numbers or strings of text that are indexed. list-variable has the following form:

$list-variable[<index>]
[<index>]

specifies a subscript that contains a number or numeric variable. The index identifies the location in the list to add an entry. If you omit the index and only specify empty brackets, or if the value of the index is greater than the highest index number, then the SET statement appends the entry to the end of the list.

Requirement: Specify brackets [ ], even if you omit an index.
Requirement: Enclose index in brackets.
Tip: List entries are accessed by positive or negative indexes. Positive indexes start at the beginning of a list. Negative indexes start at the end of a list. For example, the following list variable, $Mylist[2], identifies the second entry in the list variable $Mylist. In this case, the index is 2. The list variable $Mylist[-2] identifies the second entry from the end of the list variable $Mylist. In this case, the index is [-2].
Example: The following example adds three values onto the end of the list variable MyList and modifies the value of the second entry.
set $mylist[] 'one';
set $mylist[] 'two';
set $mylist[] 'hello';
set $mylist[2] 'This is Really two';  
Requirement: list-variable must be preceded by a '$' symbol.
Tip: List variables are accessed sequentially by using the ITERATE and NEXT statements.
Tip: After they are created, list variables are globally available in all events until you delete them using the UNSET statement.
scalar-variable

an area of memory that contains numeric or character data.

Requirement: Scalar variables must be preceded by the '$' symbol.
Tip: After they are created, list variables are globally available in all events until you delete them using the UNSET statement.
stream-variable

specifies a stream variable, which 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: user-defined-variable-name must be preceded by the '$$' symbol.
Tip: If you assign a variable entry that is the name of a memory variable to stream-variable, then the stream variable resolves as the value of the memory variable. For example, the following program uses the memory variable $MyStream as a stream variable:
set $mystream 'test';
open $mystream;
put 'The memory variable $mystream is being used as a stream variable';
close;
Therefore, these statements are equivalent:
put $$test;
putstream $mystream;
putstream test;
These statements are also equivalent:
unset $$test;
delstream $mystream;
delstream test;

Options

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: Event Statement Conditions for information about these conditions

[1] Adding Entries to Dictionary Variables

Use this form of the SET statement to add an entry to a dictionary variable.

SET $dictionary-variable entry </ event-statement-condition(s)>;

A dictionary variable is an array that contains a list of numbers or text strings that is identified by a key. A dictionary variable has, as part of its name, a preceding '$' symbol and a subscript that contains a text string or a variable that has a character value. The text or variable within the subscript is called a key. Keys are case preserving and case sensitive. After they are created, dictionary variables are globally available in all events and persist until you unset them with the UNSET statement.

An entry is a variable, string of text, or function. If a string of text follows the dictionary variable, then the entry becomes a key-value pair. For example, the following program adds two key-value pairs to a dictionary:

set $mydictionary['URL1'] 'links internally';
set $mydictionary['URL2'] 'links externally';


[2] Adding Entries to List Variables

Use this form of the SET statement to add an entry to a list variable.

SET $list-variable entry </ event-statement-condition(s)>;
A list variable is an array that contains a list of numbers or text strings that are indexed. As part of their name, list variables have a preceding '$' symbol and a subscript that is empty or contains a number or numeric variable. The number within the subscript is called an index. After they are created, list variables are globally available in all events and persist until you unset them with the UNSET statement. List entries are accessed by positive or negative indexes. Positive indexes start at the beginning of a list. Negative indexes start at the end of a list.

For example, the following list variable, $Mylist[2], identifies the second entry in the list variable $Mylist. In this case, the index is 2. The list variable $Mylist[-2] identifies the second entry from the end of the list variable $Mylist. In this case, the index is [-2].


STOP Statement


Specifies that execution moves to the end of the current statement block.
STOP </ event-statement-condition(s)>;


Options

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: Event Statement Conditions for information about these conditions

TRIGGER Statement


Executes an event.
Tip: The TRIGGER statement explicitly requests a specific action of an event.
Featured in: Creating a New Tagset, Executing Events Using the TRIGGER= Statement, Indenting Output, and Using Different Styles for Events

TRIGGER event-name <START | FINISH> </ event-statement-condition(s)>;


Required Arguments

event-name

specifies the name of the event.


Without Options

If a triggered event does not have start or finish sections, then it runs the current event statements.


Options

START

specifies the start section of an event.

Interaction: If the program is in the start section of an event, then any event that is triggered runs its start section.
FINISH

specifies the finish section of an event.

Interaction: If the program is in the finish section of an event, then any event that is triggered runs its finish section.
event-statement-condition(s)

specifies one or more conditions that must be true for the event statement to execute.

Requirement: an event-statement-condition must be preceded by a slash (/).
See: Event Statement Conditions for information about these conditions

UNBLOCK Statement


Enables a disabled event.
Interaction: To disable an event, use the BLOCK statement.
Requirement: Because you can block the same event multiple times, to enable the event use the same number of UNBLOCK statements as BLOCK statements.

UNBLOCK event-name </ event-statement-condition(s)>;


Required Arguments

event-name

specifies the name of the event.


Options

event-statement-condition(s)

specifies one or more conditions that must be true for the event statement to execute.

Requirement: an event-statement-condition must be preceded by a slash (/).
See: Event Statement Conditions for information about these conditions

UNSET Statement


Deletes a user-defined variable and its value.
UNSET ALL | dictionary-variable | list-variable | scalar-variable | stream-variable
</ event-statement-condition(s)>;


Required Arguments

ALL

deletes all dictionary variables, list variables, and scalar variables.

Tip: You must delete stream variables individually.
dictionary-variable

specifies an array that contains a list of numbers or text strings that are identified by a key. A dictionary-variable has the following form:

$dictionary-variable['key']
['key']

specifies the location in the dictionary variable of the value that you want to delete.

Requirement: Enclose key in quotation marks and brackets.
Requirement: key must be a string of text or a character variable.
Tip: key is case preserving and case sensitive.
Requirement: A dictionary-variable must be preceded by the '$' symbol.
list-variable

specifies an array that contains a list of numbers or strings of text that are indexed. A list-variable has the following form:

$list-variable[<index>]
[<index>]

specifies the location in the list variable of the value to be deleted. If you omit the index and specify empty brackets, then the entire list variable is deleted.

Requirement: Specify brackets [ ], even if you omit an index.
Requirement: index must be number or numeric variable.
Requirement: Enclose index in brackets.
Tip: List entries are accessed by positive or negative indexes. Positive indexes start at the beginning of a list. Negative indexes start at the end of a list. For example, in the following code, the first UNSET statement deletes the first entry from the top of the list variable MyList. The second UNSET statement deletes the first entry from the bottom of the MyList list variable:
unset $mylist[-1];
unset $mylist[1];
Requirement: A list-variable must be preceded by a '$' symbol.
scalar-variable

specifies a scalar variable to delete.

Requirement: Scalar variables must be preceded by the '$' symbol.
See also: SET Statement or Understanding Variables for information on scalar variables
stream-variable

specifies a stream variable to delete.

Requirement: A user-defined-variable-name must be preceded by the '$$' symbol.
Tip: If you assign a variable entry that is the name of a memory variable to stream-variable, then the stream variable resolves as the value of the memory variable. For example, the following program uses the memory variable $MyStream as a stream variable:
set $mystream 'test';
open $mystream;
put 'The memory variable $mystream is being used as a stream variable';
close;
Therefore, the following statements are equivalent:
put $$test;
putstream $mystream;
putstream test;
The following statements are also equivalent:
unset $$test;
delstream $mystream;
delstream test;
See also: SET Statement or Understanding Variables for information on memory variables

Options

event-statement-condition(s)

specifies one or more conditions that must be true for the event statement to execute.

Requirement: An event-statement-condition must be preceded by a slash (/).
See: Event Statement Conditions for information about these conditions

XDENT Statement


Indents output one less indention level, using the number of spaces specified by the INDENT= attribute.
Interaction: The starting level of indention is set by the NDENT= statement.
Featured in: Creating a New Tagset and Indenting Output

XDENT </ event-statement-condition(s)>;


Options

event-statement-condition(s)

specifies one or more conditions that must be true for the event statement to execute.

Requirement: event-statement-condition must be preceded by a slash (/).
See: Event Statement Conditions for information about these conditions


NOTES Statement


Provides information about the tagset.
Tip: The NOTES statement becomes part of the compiled tagset, which you can view with the SOURCE statement.
Featured in: Creating a New Tagset and Using the STACKED_COLUMNS Attribute in a Tagset

NOTES 'text';

Required Arguments

text

provides information about the tagset.

Requirement: When specifying text, enclose the text in quotation marks.

END Statement


Ends the tagset.
END;

Previous Page | Next Page | Top of Page