Replace Document (RPLDOC)

The Replace Document (RPLDOC) command is used to replace the document content and the interchange document profile (IDP) of a document that exists in the document library. This command places the new version of the document back into the document library. The document must be checked out before the data can be replaced.

Restrictions:

Parameters

Keyword Description Choices Notes
TODOC Document Character value, *DOCID Required, Positional 1
TOFLR In folder Character value, *NONE Optional
DOCFILE Document file Qualified object name Required, Positional 2
Qualifier 1: Document file Name
Qualifier 2: Library Name, *LIBL, *CURLIB
DOCMBR Document member Name, *FIRST Optional
DOCPART Document part *DOC, *IDP, *BOTH Optional
USRID User identifier Single values: *CURRENT
Other values: Element list
Optional
Element 1: User ID Character value
Element 2: Address Character value
DOCID Document identifier Character value, *NONE Optional
DOCTYPE Document type 2-65535, *DFT, *FFT, *RFT Optional
DOCCHRID Document character identifier Single values: *SYSVAL, *DEVD
Other values: Element list
Optional
Element 1: Graphic character set Integer
Element 2: Code page Integer
CMDCHRID Command character identifier Single values: *SYSVAL, *DEVD
Other values: Element list
Optional
Element 1: Graphic character set Integer
Element 2: Code page Integer

Document (TODOC)

Specifies the name of the document where the data is being placed, or that the Document identifier (DOCID) parameter is used to specify the library-assigned document name where the data is being placed.

name
Specify the user-assigned name of the document to be replaced.
*DOCID
The document being replaced is identified by the library-assigned document name specified on the DOCID parameter.

In folder (TOFLR)

Specifies the name of the folder that contains the document being replaced.

*NONE
No folder is specified when the document is identified on the Document identifier (DOCID) parameter.
name
Specify the name of the folder that contains the document being replaced. A folder name can consist of a series of folder names if the document being replaced is located in a folder that is contained in another folder. A maximum of 63 characters can be specified.

Document file (DOCFILE)

Specifies the names of the database file and the library that contains the document data. The database file is a user-defined file or the output file specified in either the Receive Distribution (RCVDST) command or the Retrieve Document (RTVDOC) command. If an output file is specified, only the data portion of the document data record is read from the output file. The prefix is removed from the document data record.

name
Specify the name of the database file that contains the document data.

Qualifier 2: Library

*LIBL
All libraries in the library list for the current thread are searched until the first match is found.
*CURLIB
The current library for the job is used to locate the database file. If no library is specified as the library for the job, QGPL is used.
name
Specify the library where the database file is located.

Document member (DOCMBR)

Specifies the document database file member that is used.

*FIRST
The first member created in the database file is used.
name
Specify the name of the database file member that is used.

Document part (DOCPART)

Specifies the part of the document to be replaced.

Note: If you specify *BOTH and the replacement of one fails, neither is replaced and the document remains checked out.

*DOC
Replace the document content only. If no document content records exist in the specified file, the document is replaced but a message is returned to alert the user that no document content was replaced.
*IDP
Replace only the interchange document profile (IDP) of the document. If this value is specified, IDP records (record code 500) must exist in the specified file or the command fails.
*BOTH
Replace both the document content and the IDP of the document. If this value is specified, IDP records (record code 500) must exist in the specified file or the command fails.

User identifier (USRID)

Specifies which user ID and user ID address should be associated with the request.

Single values

*CURRENT
You are performing the request for yourself.

Element 1: User ID

character
Specify another user's user ID or your user ID. You must have been given permission to work on behalf of another user or have all object (*ALLOBJ) special authority.

Element 2: Address

character
Specify another user's address or your address. You must have been given permission to work on behalf of another user or have *ALLOBJ authority.

Document identifier (DOCID)

Specifies the library-assigned name of the document. This is the name assigned to the document by the system when it was created. Documents filed outside the local system have only library-assigned document names. The library-assigned document names can be determined by using the Query Document Library (QRYDOCLIB) command or by the message returned from the File Document (FILDOC) command.

Library-assigned document names are 24 characters in length with the following format:

YYYYMMDDHHMNSSHSSNSNSNSN

where:

       YYYY = year
         MM = month
         DD = day
         HH = hour
         MN = minute
         SS = second
         HS = hundredths of a second
   SNSNSNSN = system name

*NONE
No library-assigned document name is required when the document is identified on the Document (DOC) parameter.
name
Specify the library-assigned name of the document being sent.

Document type (DOCTYPE)

Specifies the type of document being used. This identifier is used by the system to determine whether the data stream can be handled properly.

*DFT
The system creates the proper document type identifier based on the source of the data.
*FFT
The document is in Final Form Text. This type of document is intended to be viewed and printed, but not edited, by the receiver.
*RFT
The document is in Revisable Form Text. This type of document can be viewed, printed, and edited by the receiver.
2-65,535
Specify a document type identifier value. The numbers from 2 through 32,767 are controlled by registering them with the IBM Document Interchange Architecture and are used for IBM-defined document types. The numbers ranging from 32,768 through 65,535 are not registered with IBM and can be used for non-IBM-defined document types.

Document character identifier (DOCCHRID)

Specifies the character identifier (graphic character set and code page) for the document data being used. The character identifier is related to the display device used to create the document data.

Single values

*SYSVAL
The system determines the graphic character set and code page values for the command parameters from the QCHRID system value.
*DEVD
The system determines the graphic character set and code page values from the display device description where this command was entered. This option is valid only when entered from an interactive job. If this option is specified in a batch job, an error occurs.

Element 1: Graphic character set

1-32767
Specify the graphic character set to use.

Element 2: Code page

1-32767
Specify the code page to use.

Command character identifier (CMDCHRID)

Specifies the character identifier (graphic character set and code page) for the data being entered as command parameter values. The character identifier is related to the display device used to enter the command.

The value specified on the User identifier (USRID) parameter is translated to character set and code page '930 500'.

Single values

*SYSVAL
The system determines the graphic character set and code page values for the command parameters from the QCHRID system value.
*DEVD
The system determines the graphic character set and code page values from the display device description where this command was entered. This option is valid only when entered from an interactive job. If this option is specified in a batch job, an error occurs.

Element 1: Graphic character set

1-32767
Specify the graphic character set to use.

Element 2: Code page

1-32767
Specify the code page to use.

Examples

RPLDOC   TODOC(*DOCID)  DOCFILE(*LIBL/MYFILE)  DOCPART(*BOTH)
         DOCID('1987060710102053SYSTEM1')  DOCTYPE(*FFT)

This command replaces the document data and IDP with data in the file MYFILE. The data is placed in the document identified by the document identifier '1987060710102053SYSTEM1'. The document type is changed to Final Form Text.

Error messages

*ESCAPE Messages

CPF900B
User ID and address &1 &2 not in System Distribution Directory.
CPF900C
Sign on and verify of user failed.
CPF905C
Error occurred trying to find a translation table.
CPF906A
Document not replaced in library.
CPF9096
Cannot use CMDCHRID(*DEVD), DOCCHRID(*DEVD) in batch job.
CPF9847
Error occurred while closing file &1 in library &2.