The DOCUMENT Procedure

DOC Statement

Opens a document and its contents to browse or edit.
Default: Documents are opened in the UPDATE access mode.
Navigating the Directory and Listing the Entries

Opening and Listing ODS Documents

Syntax

Without Arguments

If no options are specified, then the DOC statement lists the ODS documents in all SAS libraries in alphabetical order. Document labels, if any, are displayed.

Optional Arguments

LABEL= 'label'
assigns a label to a document. For example, the following DOC statement opens the document Work.YourDoc in Write mode and assigns a label to it:
doc name=yourdoc(write) label='repeated measures results'; 
run; 
Restriction:A label can be assigned only to documents with Write access permission.
Requirements:To use the LABEL= option, specify the NAME= option in the DOC statement.

Enclose labels in quotation marks.

LIBRARY=library-name
specifies that only the documents in the specified library-name are listed.
Alias:LIB=
Interaction:The LIBRARY= option cannot be specified with the NAME= or LABEL= options.
NAME= libref.member-name <access-option(s)>
specifies the name that you assign to a document and its access mode.
<libref.>member-name
identifies a document.
Default:If no library is specified, then the Work library is used.
Restriction:The document must be a SAS library member.
access-option(s)
specifies the access mode for the document.
READ
opens a document and provides Read-Only access.
Interaction:If a label has been specified with the LABEL= option, then the label is ignored.
WRITE
opens a document and provides Write access, but only if you have Write permission.
CAUTION:
If the document already exists, then it will be overwritten. If the document does not exist, then it will be created.
Interaction:If a label has been specified with the LABEL= option, then it will override any existing label assigned to the document.
UPDATE
opens a document and provides Update access, but only if you have Update permission.
Interaction:If a label has been specified with the LABEL= option, then it will be assigned to the document.
Tip:If the document already exists, then its contents will not be changed and the new contents will be appended to the document. If the document does not exist, then it will be created.