TEMPLATE Procedure: Managing Template Stores |
Featured in: | Viewing the Source of a Template |
SOURCE item-path </ option(s)>; |
Required Arguments |
specifies the path of the item that you want to write to the SAS log. If the same item exists in multiple template stores, PROC TEMPLATE uses the one from the first template store that you can read in the current path.
Tip: | PROC TEMPLATE stores items in compiled form. The SOURCE statement actually decompiles the item. Because SAS comments are not compiled, comments that are in the source code do not appear when you decompile the item. If you want to annotate the item, use the NOTES statement inside the item or the block of editing instructions, or use the NOTES= option in the LINK statement. These notes do become part of the compiled item. (See NOTES Statement and the discussion of the NOTES= option. You can also specify notes as quoted strings in the DYNAMIC, MVAR, NMVAR, REPLACE, and STYLE statements.) |
Options |
specifies a file to write the item to.
is the name of an external file to write to.
Requirement: | The external-file that you specify must be enclosed in quotation marks. |
is a file reference that has been assigned to an external file. Use the FILENAME statement to assign a fileref.
specifies that the program not resolve links in the PARENT= statement, which specifies the item that the current item inherits from. For information about the PARENT= statement, see the PARENT= statement in the styles attribute section.
specifies the template store where the item is located.
selects items that meet a particular condition. For example, the following statement displays the source code for items that contain the word "Default" in the path to the current template:
source / where=(path ? 'Default');
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>) |
a special kind 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:
is the fully qualified path of a template.
is the type of the item. TYPE is one of the following:
specifies that the template is a column in a table.
specifies that the template is a footer in a table.
specifies that the template is a header in a table.
specifies that the template is a link or URL.
specifies that the definition is a style.
specifies that the definition is a table template .
specifies that the definition is a tagset.
is the content of any NOTES statement in the PROC TEMPLATE step that created the item. The contents is displayed in the LABEL field.
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; |
is the date the item was created.
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; |
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; |
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; |
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; |
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; |
is the date the item was modified.
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; |
compares a variable with a value or with another variable. The following table lists the 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 also: | 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. |
Copyright © 2008 by SAS Institute Inc., Cary, NC, USA. All rights reserved.