RPLDOC (Replace Document)
Purpose
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.
Restrictions
- The document must be checked out with the Retrieve Document (RTVDOC) command by the user specified on the USRID parameter before using this command.
- The user must have at least *CHANGE authority for the document, *ALLOBJ authority, or be working on behalf of a user who is authorized for the document.
- Authority to work on behalf of another user is granted with the Grant User Permission (GRTUSRPMN) command.
Required Parameters
- TODOC
- Specifies the name of the document where the data is being placed, or the DOCID parameter is used to specify the library assigned document name where the data is being replaced.
*DOCID: The document being replaced is identified by the library-assigned document name specified on the DOCID parameter.
document-name: Specify the name of the document that is replaced.
- DOCFILE
- Specifies the qualified name of the database file that contains the document data being filed. The database file can be user-defined or it can be the output file specified on the Receive Distribution (RCVDST) or Retrieve Document (RTVDOC) command. Database files that are used to replace document data are used as is with any changes. If an output file is specified, only the document data and IDP record format are read from the output file and the prefix is removed from the document data. More information on defining the format of database files is in the Database Programming topic in the Information Center.
The name of the database file can be qualified by one of the following library values:
*LIBL: All libraries in the job's library list are searched until the first match is found.
*CURLIB: The current library for the job is searched. If no library is specified as the current library for the job, the QGPL library is used.
library-name: Specify the name of the library to be searched.
database-file-name: Specify the name of the database file.
Optional Parameters
- TOFLR
- Specifies the name of the folder that contains the document being replaced.
*NONE: No folder name is specified.
folder-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. Up to 63 characters can be specified.
- DOCID
- Specifies the library-assigned name of the document being replaced. This is the name assigned to the document by the system when it is created. The library-assigned document name can be determined by using the Query Document Library (QRYDOCLIB) command. The library-assigned name is also returned in a completion message when using 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 by the TODOC parameter.
'library-assigned-document-name': Specify the library-assigned document name to be replaced. More information on library-assigned document names is in the SNA Distribution Services book.
Note: When the user is replacing a document and a cancel request is entered, the document may or may not be replaced. - DOCMBR
- Specifies the document database file member that contains the data and IDP to replace the current data and IDP in the document.
*FIRST: The first member (in order of creation) in the database file contains the replacement data.
member-name: Specify the name of the database file that contains the replacement data.
- DOCPART
- Specifies the part of the document to be replaced.
Note: If you specify DOCPART(*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.
*IPD: Replace only 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.
*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.
- DOCTYPE
- Specifies the type of replacement document. This identifier is used by the system to determine whether it can handle the data stream correctly.
The system code (SYSCOD on the File Document (FILDOC) command) cannot be changed when the document contents are replaced.
*DFT: The system creates the appropriate document type identifier depending on where the data comes from.
If the document file is an output file created by the RCVDST or RTVDOC command, then the document type is taken from this file. If the file does not contain a document type or if the value in this file is document type 0, then an error message is sent. If the document file is a user-defined file, then the document type is 223 (data file).
- Document
- Description
- Type
- 2
- Final form text document (FFTDCA)
- 3
- 5520 revisable form text document (RFT5520)
- 4
- Word processing EBCDIC (EBCDIC)
- 5
- Word processing information file (WRDPRCINFF)
- 6
- Image-data subset document (IMAGE)
- 7
- 3730 text data stream (TEXT3730)
- 8
- DIA document library descriptor document (DOCDESCDOC)
- 9
- 3732 display document data stream (DATAST3732)
- 10
- DIA display document data stream (DOCUNITCTL)
- 11
- Revisable form text document (RFTDCA)
- 12
- 1403 compatible data stream with variable length, unblocked records (PRT1403)
- 13
- Digitized ADS audio (AUDIO)
- 14
- IBM PC data file (PCFILE)
- 15
- Hard copy of document (HARDCOPY)
- 223
- Data file
- 32753
- List of documents created from search (DOCLIST)
- 32756
- Version 2 DIA document, library document, descriptor document
- 32768
- The iSeries 400 revisable-form document (RFTAS400)
- 32769
- The iSeries 400 final-form document (FFTAS400)
- 32770
- IBM DW4 revisable-form document (RFTDW4)
- 32912
- ASCII data (ASCIIDATA)
- 65262
- IBM S/38 revisable document (RFTS38)
*FFT: The document is Final Form Text. This type of document is intended to be shown and printed and not edited by the receiver.
*RFT: The document is Revisable Form Text. This type of document can be shown, printed, and edited by the receiver.
document-type-number: Specify a number from 2 through 65535. The numbers from 2 through 32767 are controlled by registering them with the IBM Document Interchange Architecture and are used for IBM-defined document types. The numbers 32768 through 65535 are not registered with IBM and can be used for non-IBM defined document types.
- USRID
- Specifies the user ID and address of the user for whom this request is made. The current user of this command must have the authority to work on behalf of the named user ID. Authority to work on behalf of another user is given with the Grant User Permission (GRTUSRPMN) command.
*CURRENT: The user profile that is currently running is used.
Element 1: User ID
user-ID: Specify the user ID of the user whose the document is replaced.
Element 2: User Address
user-address: Specify the user address of the user for whom the document is replaced.
- DOCCHRID
- Specifies the character identifier (graphic character set and code page) for the data being filed. The character identifier is related to the display station that was used to create the data being filed. More information about CHRID processing is in the Database Programming topic in the Information Center.
*SYSVAL: The system determines the graphic character set and code page values for the command parameters from the QCHRID system values.
*DEVD: The system determines the graphic character set and code page values for the command parameter from the display device description where the command is entered. This option is valid only when specified from an interactive job. If this value is specified in an interactive CL program or a batch job, an error message is sent.
Element 1: Character Set
graphic-character-set: Specify the graphic character set used to create the data being filed.
Element 2: Code Page
code-page: Specify the code page value used to create the command parameters. Valid values range from 1 through 999.
- CMDCHRID
- Specifies the character identifier (graphic character set and code page) for data being specified as parameter values on this command. This character identifier (CHRID) is related to the display device used to specify the command. More information about CHRID processing is in the Application Display Programming
book.
Note: This value translates the USRID parameter to the character set and code page of '930 500'. The SNA Distribution Services
book contains the character set and code page table for '930 500'.
*SYSVAL: The system determines the graphic character set and code page values for the command parameters from the QCHRID system values.
*DEVD: The system determines the graphic character set and code page values for the command parameter from the display device description where the command is entered. This option is valid only when specified from an interactive job. If this value is specified in an interactive CL program or a batch job, an error message is sent.
Element 1: Character Set
graphic-character-set: Specify the graphic character set values used to create the command parameter. Valid values range from 1 through 999.
Element 2: Code Page
code-page: Specify the code page value used to create the command parameters. Valid values range from 1 through 999.
Example for RPLDOC
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.