The DOCUMENT Procedure

REPLAY Statement

Displays one or more entries to the specified open ODS destination(s).
Default: If you omit the LEVELS= option, then all levels of the file are displayed to all open destinations.
Restriction: User-defined format names must be unique within an ODS DOCUMENT.
Managing Entries

Syntax

Optional Arguments

ACTIVEFOOTN
specifies that footnotes that are active in a SAS session will override the footnotes that are stored in an ODS document.
Alias:ACFOOTN
ACTIVETITLE
specifies that titles that are active in a SAS session will override the titles that are stored in an ODS document.
Alias:ACTITLE
DEST= (ODS-destination(s))
specifies one or more ODS destinations to display the output objects. For example, the following REPLAY statement replays two levels of the entry Data to the HTML and RTF destinations:
replay \Report\GLM#1\Data /levels=2 dest=(html rtf); 
run; 
Requirement:When you specify the DEST= option, enclose the ODS destinations in parentheses and separate each destination with a blank space. For example, DEST=(HTML RTF LISTING)
Tip:When you specify only one destination, you do not need to use parentheses. For example, DEST=HTML
See:For information about ODS destinations, see Understanding ODS Destinations.
LEVELS= ALL | value
specifies the number of levels that you want to replay.
ALL
specifies that all levels of the directory are displayed to all open destinations.
value
specifies the numeric value of the path level. For example, the following REPLAY statement replays two levels of the entry Data to the HTML and RTF destinations:
replay \Report\GLM#1\Data /levels=2 dest=(html rtf); 
run;
Default:ALL
Restriction:The LEVELS= option is valid only when you specify a directory.
path
specifies the location of an entry. An entry can be one or more directories, links, or output objects.
Requirement:Separate multiple paths with commas.
Tip:You can use the symbol '^' to represent the current directory and the symbol '^^' to represent the parent directory.
(WHERE=(where-expression-1<operator >))
conditionally selects a subset of entries in an ODS document.
where-expression
is an arithmetic or logical expression that consists of a sequence of operators and operands.
operand
is one of the following:
constant
is a fixed value such as a date literal, a value, or a BY variable value.
SAS function
For information about SAS functions, see SAS Functions and CALL Routines: Reference.
subsetting variable
is a special type of WHERE expression operand used by the DOCUMENT procedure to help you find common values in ODS documents. Here are the subsetting variables:
_CDATE_
is the creation date of the current entry.
Example:The following MOVE TO statement moves all entries of the type 'Graph' with a creation date of 16JUL2004 to the Monthly directory of Work.MyDoc:
move ^(where=(_type_ = 'Graph' and _cdate_ = '16JUL2004'd)) to
   \ work.mydoc\monthly;
run;
_CDATETIME_
is the creation datetime of the current entry.
Example:The following COPY TO statement copies all entries with a creation datetime of May 1, 2003, at 9:30 to the Monthly directory of Work.MyDoc:
copy ^(where=(_cdatetime_ = '01may04:9:30:00'dt)) to \work.mydoc\monthly;
run;
_CTIME_
is the creation time of the current entry.
Example:The following DELETE statement deletes all entries with a creation time of 9:25:19 PM:
delete ^(where=(_ctime_ = '9:25:19pm't));
run;
_LABEL_
is the label of the current entry.
Example:The following LIST statement lists all tables containing the label 'Type III Model' within the GLM procedure:
list glm(where=(_type_ = 'table' _label_ ? 'Type III Model'));
run;
_LABELPATH_
is the path to the label of the current entry. Document label paths are formed by concatenating the labels and sequence numbers, and then separating them with the forward slash (/) symbol. Document label paths are similar to the label paths specified by the ODS TRACE statement.
For example, suppose that this is the ODS TRACE label path:
'The Univariate Procedure'.'Normal_x'.'Histogram 1'
The corresponding document label path would be as follows:
'The Univariate Procedure'#1\'Normal_x'#1\'Histogram 1'#1
Note that in document label paths, the instances of '.' are replaced with '\'.
Example:The following LIST statement lists all items containing “Fit Statistics” in the label path.
list gml(where=(_labelpath_ ? "Fit Statistics"))/levels=all;
run;
_MAX_
is the last observation.
Restrictions: _MAX_ is used only for output objects.

_MAX_ is used only in the REPLAY statement.

Example:The following REPLAY statement replays all observations except the last observation:
replay class(where=(_obs_ < _max_));
_MDATE_
is the modification date of the current entry.
Example:The following MOVE TO statement moves all entries of the type 'Graph' with a modification date of 16JUL2004 to the Monthly directory of Work.MyDoc:
move ^(where=(_type_ = 'Graph' and _mdate_ = '16JUL2004'd)) to
   \work.mydoc\monthly;
run;
_MDATETIME_
is the modification datetime of the current entry.
Example:The following REPLAY statement replays all entries with a modification datetime of May 1, 2003, at 9:30:
replay ^(where=(_mdatetime_ = '01may04:9:30:00'dt));
run;
_MIN_
is the first observation.
Restrictions:_MIN_ is used only for output objects.

_MIN_ is always set to 1

_MIN_ is used only in the REPLAY statement.

Example:The following REPLAY statement replays all observations except the first observation:
replay class(where=(_obs_ <  _min_));
_MTIME_
is the modification time of the current entry.
Example:The following COPY TO statement copies all entries with a modification time of 9:25:19 PM to the Monthly directory of Work.MyDoc:
copy ^(where=(_mtime_ = '9:25:19pm't)) to \work.mydoc\monthly;
run;
_NAME_
is the name of the current entry.
Example:The following DELETE statement deletes all entries that contain the name “stemleng” within the GLM procedure:
delete glm(where=(_name_ ? 'stemleng'));  
_OBS_
is the current observation number in an output object.
Restrictions:_OBS_ is used only for output objects.

_OBS_ is used only in the REPLAY statement.

Examples:The following REPLAY statement replays all but the first ten observations:
replay class(where=(_obs_ > 10));

The following REPLAY statement replays all observations except the last observation:

replay class(where=(_obs_ < _max_));

The following REPLAY statement replays the first, third, fifth, seventh, and ninth observations:

replay class(where=(_obs_ in (1,3,5,7,9)));

observation-number
is the observation number to be replayed.
Restrictions:observation-number is used only for output objects.

observation-number is used only in the REPLAY statement.

Example:The following REPLAY statement replays the first, third, fifth, seventh, and ninth observation:
replay class(where=(_obs_ in (1,3,5,7,9)));
observation-variable
is the name of an observation.
Restrictions:observation-variable is used only for output objects.

observation-variable is used only in the REPLAY statement.

Examples:The following REPLAY statement replays all observations where the variable Weight is greater than 100:
replay class(where=(weight>100));

The following REPLAY statement replays all observations where the variable Sex is equal to ‘F’.

replay class(where=(sex='F'));

_PATH_
is the path of the current entry.
Example:The following LIST statement lists all entries with a path containing the substring 'Anova' at all levels of the current directory:
list ^(where=(_path_ ? 'Anova'));
run;
_SEQNO_
is the sequence number of the current entry.
Example:The following REPLAY statement replays all entries that have a sequence number of 2 in the GLM procedure:
replay glm(where=(_seqno_ = 2));  
_TYPE_
is the type of the current entry.
Example:The following MOVE TO statement moves all entries of the type 'Graph' with a creation date of July 16, 2004, to the Monthly directory of Work.MyDoc:
move ^(where=(_type_ = 'Graph' and _cdate_ = '16JUL2004'd)) to
     \work.mydoc\monthly;
run;
variable- name
is the name of a BY variable.
Example:The following MOVE TO statement moves all entries where the value of the variable Gender is 'F' to the Monthly directory of Work.MyDoc:
move ^(where=(gender='F')) to \work.mydoc\monthly;
run;
operator
compares one variable with a value or another variable. operator can be AND, OR NOT, OR, AND NOT, or a comparison operator.
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
Restriction:For the REPLAY statement, the WHERE= option applies to directories and output objects. For the following statements, the WHERE= option applies to directories only:
  • COPY TO
  • DELETE
  • LIST
  • MOVE TO
Requirement:Enclose where-expression in quotation marks.
See:You can use any expression that can be used in the WHERE= data set option. For information about expressions that you can use in the WHERE data set option, see the WHERE data set option in SAS Data Set Options: Reference and the section on WHERE-Expression Processing in SAS Language Reference: Concepts.