Overview (ADD DOCUMENT command)

ADD DOCUMENT saves a block of text of any length in the active dataset. The result is equivalent to the DOCUMENT command. The documentation can be displayed with the DISPLAY DOCUMENT command.

When GET retrieves a data file, or APPLY DICTIONARY is used to apply documents from another data file, or ADD FILES, MATCH FILES, or UPDATE is used to combine data files, all documents from each specified file are copied into the working file. DROP DOCUMENTS can be used to drop those documents from the working file.

Basic Specification

The basic specification is ADD DOCUMENT followed by one or more optional lines of quoted text. The text is stored in the file dictionary when the data file is saved in IBM® SPSS® Statistics format.

Syntax Rules

  • Each line must be enclosed in single or double quotation marks, following the standard rules for quoted strings.
  • Each line can be up to 80 bytes long (typically 80 characters in single-byte languages), including the command name but not including the quotation marks used to enclose the text. If any line exceeds 80 bytes, an error will result and the command will not be executed.
  • The text can be entered on as many lines as needed.
  • Multiple ADD DOCUMENT commands can be specified for the same data file.
  • The text from each ADD DOCUMENT command is appended to the end of the list of documentation, followed by the date in parentheses.
  • An ADD DOCUMENT command with no quoted text string appends a date in parentheses to the documentation.
  • DISPLAY DOCUMENTS will display all documentation for the data file specified on the ADD DOCUMENT and/or DOCUMENT commands. Documentation is displayed exactly as entered; each line of the ADD DOCUMENT command is displayed as a separate line, and there is no line wrapping.
  • DROP DOCUMENTS deletes all documentation created by both ADD DOCUMENT and DOCUMENT.

Example

If the command name and the quoted text string are specified on the same line, the command name counts toward the 80-byte line limit, so it’s a good idea to put the command name on a separate line, as in:

ADD DOCUMENT
  "This is some text that describes this file.".

Example

To insert blank lines between blocks of text, enter a null string, as in:

ADD DOCUMENT
  "This is some text that describes this file."
  ""
  "This is some more text preceded by a blank line.".