The DOCUMENT Procedure

PROC DOCUMENT Statement

Creates or opens a document to modify.
Default: Documents are opened in the UPDATE access mode.
Restriction: User-defined format names must be unique within an ODS DOCUMENT.
Note: If the DOCUMENT destination is not closed with an ODS DOCUMENT CLOSE statement, then ODS continues to append files to the document.

Syntax

PROC DOCUMENT <options <access-option(s)>>;

Optional Arguments

NAME= <libref.>member-name <access-option(s)>
specifies the name of a new or existing document and its access mode.
<libref.>member-name
identifies a new or existing ODS document.
Default:If no library is specified, then the Work library is used.
Restriction:The ODS document must be a SAS library member.
access-option(s)
specifies the access mode for the ODS document. For example, the following PROC DOCUMENT statement opens the document Work.MyDoc in Update mode:
proc document name=mydoc;
run; 
Default:UPDATE
READ
is an access-option that opens a document and provides Read-Only access.
Requirement:To open a document in the READ access mode, the document must already exist.
Interaction:If a label has been specified with the LABEL= option, then the label is ignored.
WRITE
is an access-option that opens a document and provides Read and Write access. For example, the following PROC DOCUMENT statement opens the document Work.YourDoc in Write mode:
proc document name=yourdoc(write);
run;
Interaction:If a label has been specified with the LABEL= option, then it will override any existing label assigned to the document.
Tip:If the ODS document does not exist, then it will be created.
CAUTION:
If the ODS document already exists, then it will be overwritten.
UPDATE
is an access-option that opens an ODS document and appends new content to the document. UPDATE provides Update access as well as Read access.
Interaction:If a label has been specified with the LABEL= option, then it will be assigned to the document.
Tip:If the ODS document does not exist, then the document will be created.
CAUTION:
If the document already exists, then its contents will not be changed.
LABEL= 'label'
assigns a label to a document. For example, the following PROC DOCUMENT statement opens the document Work.YourDoc in Write mode and assigns a label to it:
proc document name=yourdoc(write) label='repeated measures results'; 
run;
Restriction:Labels can be assigned only to documents with Write-access permissions.
Requirement:Enclose labels in quotation marks.