TEMPLATE Procedure: Managing Template Stores

LIST Statement

Lists the items in one or more template stores.
Listing Templates in a Template Store

Syntax

Optional Argument

starting-path
specifies a level within each template store where PROC TEMPLATE starts listing items. For example, if starting-path is base.univariate, PROC TEMPLATE lists only base.univariate and the items within it and within all the levels that it contains.
Default:If you omit a starting-path, then the LIST statement lists all items in all template stores unless the ODS PATH statement confines the search to the specified template stores.
Restriction:This option must precede the forward slash (/) in the LIST statement.

Options

SORT=statistic <sorting-order>
sorts the list of items by the specified statistic in the specified sorting order.
statistic
is one of the following:
CREATED
is the date that the item was created.
NOTES
is the content of any NOTES statement in the PROC TEMPLATE step that created the item.
Alias:LABEL
LINK
is the name of the item that the current item links to (see LINK Statement).
PATH
is the path to the current item in the template store. (The path does not include the name of the template store).
SIZE
is the size of the item.
TYPE
is the type of the item: COLUMN, FOOTER, HEADER, STYLE, TABLE, or LINK. If the item is simply a level in the item store, its type is DIR.
Default:PATH
sorting-order
specifies whether SORT= sorts from low values to high values or from high values to low values.
ASCENDING
sorts from low values to high values.
Alias:A
DESCENDING
sorts from high values to low values.
Alias:D
Default:ASCENDING
STATS=ALL | (statistic-1 <, … statistic-n>)
specifies the information to include in the list of items.
ALL
includes all available information.
(statistic-1 <, … statistic-n>)
includes the specified information. statistic is one or more of the following:
CREATED
is the date that the item was created.
NOTES
is the content of any NOTES statement in the PROC TEMPLATE step that created the item.
Alias:LABEL
LINK
is the name of the item that the current item links to (see LINK Statement).
SIZE
is the size of the item.
Default:Whether or not you specify STATS=, the list of items always includes an observation number, the path to the item, and its type.
STORE=libref.template-store
specifies the template store to process.
Default:All template stores in the current template path.
See:For information about setting the current template path, see the PATH Statement.
WHERE=where-expression
selects, for listing, items that meet a particular condition. For example, the following statement lists items that contain the word “Default” in the path to the current template:
list / where=(path ? 'Default');
where-expression
is an arithmetic or logical expression that consists of a sequence of operators and operands.
where-expression has this form:
(subsetting-variable <comparison-operator where-expression-n>)
subsetting-variable
is a special type of WHERE expression operand used by the SOURCE statement to help you find common values in items. Subsetting variables are one or more of the following:
PATH | _PATH_
is the fully qualified path of a template.
Aliases:NAME | _NAME_

TEMPLATE | _TEMPLATE_

Example:This SOURCE statement displays the code for all items that contain the word “Default” in the name of the current template:
source / where=(path ? 'Default'); run;
.
TYPE | _TYPE_
is the type of the item. TYPE is one of the following:
COLUMN
specifies that the template is a column in a table.
FOOTER
specifies that the template is a footer in a table.
HEADER
specifies that the template is a header in a table.
LINK
specifies that the template is a link or URL.
STYLE
specifies that the definition is a style.
TABLE
specifies that the definition is a table template.
TAGSET
specifies that the definition is a tagset.
Example:This SOURCE statement displays the source code for all tagsets that have the word “Default” in the path:
source / where=(lowcase(type) = 'tagset' && _path_ ? 'Default');
The LOWCASE function converts all letters in an argument to lowercase.
NOTES
is the content of any NOTES statement in the PROC TEMPLATE step that created the item. The contents is displayed in the LABEL field.
Alias:LABEL
Example:This SOURCE statement displays the source code for all items where the label contains the words “common matrix” and the item is a link:
source / where=(lowcase(label) ? 'common matrix' && _type_ = 'Link'); 
run;
The LOWCASE function converts all letters in an argument to lowercase.
SIZE
is the size of the item in bytes.
Example:This SOURCE statement displays the source code for all items that are larger than 70000 bytes:
source / where=(size > 70000); 
run;
CREATED
is the date the item was created.
Example:This SOURCE statement displays the source code for all of the items that were created today in all of the template stores in the current template path:
source / where=(datepart(created) = today());
The DATEPART function extracts the date from a SAS datetime value.
CDATE | _CDATE_
is the creation date of the item.
Example:This SOURCE statement displays the source code for all of the items with a creation date of 16JUL2004:
source / where=(_cdate_ = '16JUL2004'd); 
run;
CDATETIME | _CDATETIME_
is the creation datetime of the item.
Example:This SOURCE statement displays the source code for all items with a creation SAS datetime of May 1, 2003 at 9:30:
source / where=(_cdatetime_ = '01may04:9:30:00'dt); 
run;
CTIME | _CTIME_
is the creation time of the item.
Example:This SOURCE statement displays the source code of all items with a creation time of 9:25:19 PM:
source / where=(_ctime_ = '9:25:19pm't); 
run;
MDATE | _MDATE_
is the modification date of the item.
Example:This SOURCE statement displays the source code of all items with a modification date of 16JUL2004:
source / where=(_mdate_ = '16JUL2004'd); 
run;
MDATETIME | _MDATETIME_
is the modification datetime of the item.
Example:This SOURCE statement displays the source code of all items with a modification SAS datetime of May 1, 2003 at 9:30:
source / where=(_mdatetime_ = '01may04:9:30:00'dt); 
run;
MODIFIED
is the date the item was modified.
Example:This SOURCE statement displays the source code of all items that were modified today in all of the template stores in the current template path:
source / where=(datepart(modified) = today());
The DATEPART function extracts the date from a SAS datetime value.
MTIME |_MTIME_
is the modification time of the item.
Example:This SOURCE statement displays the source code of all items with a modification time of 9:25:19 PM:
source / where=(_mtime_ = '9:25:19pm't); 
run;
comparison-operator
compares a variable with a value or with another variable. The following table lists the comparison operators:
Comparison Operators
Symbol
Mnemonic Equivalent
Definition
=
EQ
Equal to
^= or ~= or ¬= or <>
NE
Not equal to
>
GT
Greater than
<
LT
Less than
>=
GE
Greater than or equal to
<=
LE
Less than or equal to
IN
Equal to one from a list of values
See:For information about expressions that you can use in the WHERE data set option, see the WHERE data set option and the section on WHERE-Expression Processing.