Where allowed to run: All environments (*ALL) Threadsafe: No |
Parameters Examples Error messages |
The Copy Remote Source File Member (CPYSRCRMT) command performs the same function as the IBM i CPYSRCF (copy source file) command, except it allows you to specify a remote IBM i system on which the source code is copied to, copied from or both. CPYSRCRMT is one of my favorite commands because it retains all source file statement attributes, such as line change dates and sequence numbers--data that is normally lost when using other tools, such as FTP. CPYSRCRMT used DDM files "under the covers" therefore DDM must be active on both systems.
This command allows you to:
Top |
Keyword | Description | Choices | Notes |
---|---|---|---|
FROMSRC | From source file | Element list | Required, Positional 1 |
Element 1: Source file | Qualified object name | ||
Qualifier 1: Source file | Name | ||
Qualifier 2: From library | Name, *LIBL, *CURLIB | ||
Element 2: From System | Character value, *LOCAL | ||
TOSRC | To source file | Element list | Required, Positional 2 |
Element 1: Source file | Qualified object name | ||
Qualifier 1: Source file | Name, *FROMSRC | ||
Qualifier 2: To library | Name, *FROMLIB, *LIBL, *CURLIB | ||
Element 2: To System | Character value, *LOCAL | ||
FROMMBR | From member | Generic name, name, *ALL, *FIRST | Required, Positional 3 |
TOMBR | To member | Name, *FROMMBR, *FIRST | Optional, Positional 4 |
MBROPT | Replace or add records | *ADD, *REPLACE | Optional, Positional 5 |
SRCTYPE | To member SEU Type (v7.1) | Name, *SAME, *FROMMBR | Optional, Positional 6 |
TEXT | Text 'description' (v7.1) | *SAME, *FROMMBR | Optional, Positional 7 |
Top |
Specify the source file and library where the source member is located.
This is a required parameter.
Source file
A qualified source file name. It must exist on the IBM i system specified in the FROM SYSTEM portion of this parameter.
From System
Top |
Specify the source file and library where the source member is being copied to.
This is a required parameter.
Source file
To Library
To System
Top |
Specify the source member being copied. This parameter can be generic and also supports *ALL.
This is a required parameter.
Top |
Specify the source member name in the TOSRC to receive the copy of the source member named on the FROMMBR parameter.
Top |
Specifies whether the copied records are added to the end of the TOMBR if it already exists, or if the data in the TOMBR is replaced with the copied records.
Top |
Specify the SEU Source Type to assign to the To Source Member. This parameter is valid on IBM i v7.1 or later. It is ignored on earlier release levels.
Top |
Top |
Example 1: Copy from local source to remote source
CPYSRCRMT FROMSRC(MYLIB/QRPGLESRC) TOSRC(TESTLIB/*FROMSRC CHICAGO) FROMMBR(WEBAPP2)
This command copies the source member WEBAPP2 from the local system to the QRPGLESRC source file in library TESTLIB on the remote system named CHICAGO.
Example 2: Copy From Remote To Local
CPYSRCRMT FROMSRC(TESTLIB/QRPGLESRC CHICAGO) TOSRC(MYLIB/*FROMSRC) FROMMBR(WEBAPP2)
This command copies the source member WEBAPP2 from the remote system named CHICAGO to the local system.
Example 3: Copy from Remote System to Another Remote System
CPYSRCRMT FROMSRC(TESTLIB/QRPGLESRC CHICAGO) TOSRC(MYLIB/*FROMSRC PHOENIX) FROMMBR(WEBAPP2)
This command copies the source member WEBAPP2 from the remote system named CHICAGO to another remote system named PHOENIX.
Top |
Top |