TEMPLATE Procedure: Managing Template Stores

Example 2: Using a WHERE Expression to Select Items in a Template Store

Features:

PATH statement

LIST statement: :
where-expression option
starting-path option
SORT= option

Details

This example uses a WHERE expression to select, for listing, fitted distribution table templates in the Base.Univariate directory.

Program

options nodate pageno=1 pagesize=60 linesize=72;
proc template;
path sashelp.tmplmst;
list base.univariate / sort=path descending
where=(lowcase(path) ? 'fit');
run;

Program Description

Set the SAS system options. The OPTIONS statement controls several aspects of the LISTING output. None of these options affects the HTML output.
options nodate pageno=1 pagesize=60 linesize=72;
Specify which locations to search for items that were created by PROC TEMPLATE. The PATH statement specifies to search for items that were created by PROC TEMPLATE in the Sashelp.Tmplmst item store.
proc template;
path sashelp.tmplmst;
List, in descending order, the items with the word "fit" in their pathname.The LIST statement lists the items in one or more template stores. The starting path base.univariate specifies the level within the template store where PROC TEMPLATE is to start listing the items. The WHERE expression finds items in the template store that have the word "fit" in their pathname. The LOWCASE function converts all letters in an argument to lowercase. The SORT= option sorts the list of items. The items are sorted in descending order.
list base.univariate / sort=path descending
where=(lowcase(path) ? 'fit');
run;

Output

Listing of Fitted Distribution Templates in the Base.Univariate Template Store
Listing of Fitted Distribution Templates In the Base.Univariate Template Store