Previous Page | Next Page

The DOCUMENT Procedure

DOC Statement


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

DOC <options <access-option(s)>>;


Without Options

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.


Options

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.
Requirement: To use the LABEL= option, specify the NAME= option on the DOC statement.
Requirement: 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.

Previous Page | Next Page | Top of Page