Move Document (MOVDOC)

Where allowed to run: All environments (*ALL)
Threadsafe: No
Parameters
Examples
Error messages

The Move Document (MOVDOC) command changes the path the system uses to search for a document. The document is not physically moved to another location of auxiliary storage, and a new object is not created.

Restrictions:

Top

Parameters

Keyword Description Choices Notes
FROMDOC From document Character value, *SYSOBJNAM Required, Positional 1
FROMFLR From folder Character value, *NONE Optional, Positional 2
TOFLR To folder Character value, *NONE Optional, Positional 3
RENAME Rename Character value, *SAME Optional, Positional 4
SYSOBJNAM System object name Name Optional
Top

From document (FROMDOC)

Specifies the document to be moved. If a document name is specified on the FROMDOC parameter, then a folder name must be specified on the From folder (FROMFLR) parameter. If *SYSOBJNAM is specified on the FROMDOC parameter, then a system object name must be specified on the System object name (SYSOBJNAM) parameter.

Note: If FROMDOC(name) is specified, then FROMFLR(name) is required. If FROMDOC(*SYSOBJNAM) is specified, then SYSOBJNAM(name) and RENAME(name) are required.

This is a required parameter.

*SYSOBJNAM
A system object name is used to identify the document to be moved. This parameter must be used to move a folderless document and may be used instead of a folder/document name any time the system object name is known.
name
Specify the name of the document to be moved.
Top

From folder (FROMFLR)

Specifies the name of the folder from which the document is being moved. A folder name must be entered on this parameter if a document name is entered on the From document (FROMDOC) parameter. FROMFLR(*NONE) cannot be specified if FROMDOC(name) is specified.

*NONE
The document to be moved is specified by its system object name.
name
Specify the name of the folder containing the document to be moved.
Top

To folder (TOFLR)

Specifies the name of the folder into which the document is being moved. A folder name must be entered in this parameter if a document name is entered in the Rename (RENAME) parameter.

*NONE
The document is to become a folderless object. If you specify TOFLR(*NONE), the document becomes folderless and can only be referred to by its system object name.
name
Specify the name of the folder that is to contain the document.
Top

Rename (RENAME)

Specifies the name by which the moved document is to be known in the TOFLR folder. This parameter allows the user to name a document when moving a folderless document to a folder. It also allows the user to rename the document when moving it from one folder to another.

If the user wants to move a document into a folder, the name of the document in the TOFLR folder must be unique.

If the new name is already assigned to a folder or a document in a folder specified on the TOFLR parameter, the user must either choose a new name for the target document or rename the folder or document that has the same name.

Note: If FROMDOC(*SYSOBJNAM) is specified, then RENAME(name) must be specified.

*SAME
The document name does not change when moving it from one folder to another, or the document will no longer have a name when making it folderless.
name
Specify the name of the moved document in the TOFLR folder.
Top

System object name (SYSOBJNAM)

Specifies the system object name of the document to be moved. This parameter can only be specified if FROMDOC(*SYSOBJNAM) is specified.

name
Specify the system object name.
Top

Examples

Example 1: Adding a Folderless Document

MOVDOC   FROMDOC(*SYSOBJNAM)  FROMFLR(*NONE)  TOFLR(FLR1)
         RENAME(DOC1)  SYSOBJNAM(CNTR192366)

This command, whose system object name is CNTR192366, adds a folderless document to FLR1 and names it DOC1.

Example 2: Moving a Document and Keeping its Name

MOVDOC   FROMDOC(DOC1)  FROMFLR(FLR1)  TOFLR(FLR2)
         RENAME(*SAME)

This command moves DOC1 from FLR1 to FLR2 and keeps the name DOC1.

Example 3: Moving and Renaming a Document

MOVDOC   FROMDOC(DOC1)  FROMFLR(FLR1)  TOFLR(FLR2)
         RENAME(DOC2)

This command moves DOC1 from FLR1 to FLR2 and renames it DOC2.

Example 4: Moving a Document and Making It Folderless

MOVDOC   FROMDOC(DOC1)  FROMFLR(FLR1)  TOFLR(*NONE)

This command moves DOC1 from FLR1 and changes it to a folderless document.

Top

Error messages

*ESCAPE Messages

CPF8A13
Document &2 in folder &1 not moved.
Top