TEMPLATE Procedure: Creating Table Templates

EDIT Statement

Edits an existing template. The EDIT statement replaces the DEFINE statement in a template block when editing. You can use the EDIT statement in place of any DEFINE statement.
Restriction: If you edit a template that is a link, the link is broken and a separate template is created.
Requirement: An END statement must follow the EDIT statement and all of the editing instructions.
Interaction: In some cases, you can use an EDIT statement inside a set of editing instructions. When you edit a table template, you can also edit one or more column, header, or footer templates that are defined in the table. When you edit a column template, you can also edit one or more header templates that are defined for that column.
Editing a Table Template That a SAS Procedure Uses

Syntax

Required Argument

template-path-1
specifies a template to edit. template-path-1 consists of one or more names that are separated by periods. Each name represents a directory in a template store, which is a type of SAS file.
Interaction:The STORE= option specifies a particular template store to read from and write to.
Tip:To determine the templates that a procedure or DATA step uses, submit the ODS TRACE ON statement before you run the SAS program. (See ODS TRACE Statement.)

Optional Arguments

AS template-path-2
specifies the location in which to store the edited template, where template-path-2 consists of one or more names that are separated by periods. Each name represents a directory in a template store, which is a type of SAS file. By default, PROC TEMPLATE writes the edited template to the first writable template store in the current path.
Default:If you omit AS template-path-2, PROC TEMPLATE writes the edited template to template-path-1 in the first writable template store.
Restriction:If the current EDIT statement is inside a set of editing instructions, do not use the AS template-path-2 option.
STORE=libref.template-store
specifies the template store from which to read template-path-1 and in which to store template-path-2.
template-statements
template-statements are any statements or attributes that are valid between the DEFINE statement and the END statement.

Editing an Existing Template

When you use the EDIT statement, the following occurs:
  • By default, PROC TEMPLATE looks for template-path-1 in the list of template stores that is defined by the PATH statement. (See PATH Statement.) It opens a copy of the first template path that it finds in a template store that has Read access.
  • PROC TEMPLATE writes the modified template to the first template store in the current path with Update access. If you omit a second template path to write to, then PROC TEMPLATE uses template-path-1. Therefore, if the template store from which template-path-1 is read has Update access, you are actually modifying the original template. Otherwise, the modified file is written to a template store to which you do have Update access.
    If you do specify a second template path, then PROC TEMPLATE writes the edited template to the specified path in the first template store to which you have Write access.