Previous Page | Next Page

The DOCUMENT Procedure

PROC DOCUMENT Statement


Creates or opens a document to modify.
Default: Documents are opened in the UPDATE access mode.
Caution: If the DOCUMENT destination is not closed with an ODS DOCUMENT CLOSE statement, then ODS continues to append files to the document.

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


Without Options

If no options are specified, then the PROC DOCUMENT statement opens the last document that was created in the current SAS session.


Options

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

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

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;
Caution: If the ODS document already exists, then it will be overwritten.
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.
UPDATE

opens an ODS document and appends new content to the document. UPDATE provides Update access as well as Read access.

Caution: If the document already exists, then its contents will not be changed.
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.
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.

Previous Page | Next Page | Top of Page