The DOCUMENT Procedure

Overview: DOCUMENT Procedure

Using the DOCUMENT Procedure

The combination of the ODS DOCUMENT statement and the DOCUMENT procedure enables you to store a report’s individual components and then modify and replay the report. The ODS DOCUMENT statement stores the actual ODS objects that are created when running a report. You can then use the DOCUMENT procedure to rearrange, duplicate, or remove output from the results of a procedure or a database query without invoking the procedures from the original report. You can also use the DOCUMENT procedure to do the following:
  • transform a report without rerunning an analysis or repeating a database query
  • modify the structure of output
  • display output to any ODS output format
  • navigate the current directory and list entries
  • open and list ODS documents
  • manage output
With the DOCUMENT procedure, you are not limited to simply regenerating the same report. You can change the order in which objects are rendered, the table of contents, the templates that are used, macro variables, and ODS and system options.
Unlike other ODS destinations, the DOCUMENT destination has a graphical user interface (GUI), called the Documents window, for performing tasks. However, you can perform the same tasks with batch statement syntax using the DOCUMENT procedure. For a comparison of the Documents window and the DOCUMENT procedure, see Comparisons between the Documents Window and the Results Window. For an example of using the Documents window to rearrange output, see Rearranging Output with the Documents Window. For an example of replaying output with the Documents window, see Replaying a Document Using the Document Window.

DOCUMENT Procedure Terminology

current document
is the open document.
current directory
is your current location in the open document. The '^' symbol represents the current directory.
is a directory, output object, note, or link.
graph segment
is an output object that contains a graph. Graphs are created in some SAS procedures, including those in SAS/GRAPH. The graph output object is referenced as a GRSEG.
ODS document
is the hierarchy of output objects that are created by the DOCUMENT procedure. These objects are unformatted and are placed in a SAS item store.
is the route through an ODS document, leading to a particular entry. The ‘^’ symbol represents the current directory and the ‘^^’ symbol represents the parent directory.
is the regeneration of output, in the same or different format, without rerunning analyses or data queries.
root directory
is the top level of an ODS document. The root is not contained within another directory and it does not have a name assigned. The root is similar to the root directory of a Windows file system.