Previous Page | Next Page

The DOCUMENT Procedure

Concepts: DOCUMENT Procedure


About ODS Documents


Definition

An ODS document is a hierarchical file of output objects that is created from a procedure or data query. The output objects are in unformatted form, and they are stored in a SAS item store. The hierarchy is controlled by the internal logic of the procedure or data query.


Items Included in an ODS Document

In an ODS document, each level of the hierarchical file represents a path which refers to the location of a file, link, or output object. An output object can be one of the following:


Items Not Included in an ODS Document

An ODS document does not store the following items:


ODS Document Persistence

An ODS document is a member of a SAS library. Therefore, you can browse, edit, and replay the output contained in the ODS document to any ODS destination without rerunning the SAS programs that created the initial output. An ODS document persists in the SAS System until the document, or the SAS library containing the document, is deleted. Thus an ODS document that was created in the SASUSER library, or in another permanent SAS library, can persist indefinitely because it is considered a permanent archive of SAS procedure output. However, an ODS document that is created in the WORK library does not persist longer than the SAS session that created it. For information about SAS libraries, see SAS Language Reference: Concepts.


Understanding an ODS Document Path


Definition of ODS Document Path

Because an ODS document is stored as an item store, this file format enables client applications to define a "hierarchal file system within a file." This is similar to a directory system in a Windows operating environment, or a partitioned data set in a mainframe operating environment. Therefore, an ODS document path means the location of an entry.


Entry Names

Entry names follow these rules:

Entries are inserted into an ODS document in the following three ways:


Understanding Sequence Numbers

Entry names are not required to be unique within an ODS document. However, they are uniquely identifiable because they contain sequence numbers. Every entry in an ODS document, except for the root file location, has a sequence number. A sequence number is a positive integer that is unique with respect to the name of the entry within the same file location level. Entries are assigned sequence numbers according to the sequence in which they are added to a file location. For example, the first entry myname is assigned a sequence number 1, myname#1. The second entry myname is assigned a sequence number 2, myname#2. Sequence numbers are never reassigned, unless all entries with the same name are deleted. In this case, the sequence numbers are reset to an initial number of 1.


ODS Documents and Base SAS Procedures

You can create an ODS document from almost any Base SAS procedure. The PRINT, REPORT, and TABULATE procedures use table templates that are created by the user, and not defined by a template in ODS. These procedures use custom table templates, custom data components, and custom formats for their output objects. Nevertheless, the ODS document and all of its features are supported for the TABULATE and REPORT procedures. ODS documents do not support some features of PROC PRINT. For example, BY group processing in the PRINT procedure is not supported.


Getting Familiar with Output Objects

An output object is one of the following:

Output objects have associated information and attributes. Some or all of these attributes pertain to output objects.
after-note

is the note assigned to the output object by the procedure that produced the object. This note is displayed every time the output object is displayed. After-notes display after the output object.

before-note

is the note assigned to the output object by the procedure that produced the object. This note is displayed every time the output object is displayed. Before-notes display before the output object.

footnote

is created by the FOOTNOTE statement and is displayed when the output object is created.

page break

causes a page break prior to displaying the output object and any associated titles and notes.

subtitle

is the title that is assigned to the output object by the procedure that produced the output object. This title is displayed every time a new page of output is started.

title

is created by the TITLE statement and is displayed when the output object is created.

Here is the order in which the attributes of an output object are displayed:

  1. page break

  2. titles

  3. subtitles

  4. before-notes

  5. output object

  6. after-notes

  7. footnotes


Understanding How ODS Documents Interact across Operating Environments


Compatibility across SAS Versions

An ODS document that is created in the current version of SAS is compatible with later versions of SAS. In most cases, an ODS document created in a later version of SAS will still be compatible with an earlier version of SAS.

ODS documents are not portable across operating environments. For example, an ODS document created in a Windows operating environment cannot be used in a mainframe operating environment.

Previous Page | Next Page | Top of Page