COZZI-Copy Remote Src Mbr (CPYSRCRMT)

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

Parameters

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

From source file (FROMSRC)

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

*LOCAL
Specify *LOCAL when the source file member to be coped exists on the local IBM i system.
character-value
Specify the remote system name or IP address where the FROM SOURCE file member currently exists.
Top

To source file (TOSRC)

Specify the source file and library where the source member is being copied to.

This is a required parameter.

Source file

*FROMSRC
If the target source file has the same name as the FROM SOURCE file use *FROMSRC to simplify the command. Note that *FROMSRC applies to the source file name portion only, NOT the library. If the library is unspecified on the TOSRC parameter, and *FROMSRC is also specified, then the FROMSRC library name is also used.
name
Specify the name of source file that exists on the system identified on the system portion of this parameter.

To Library

name
Specify the name of library containing the TOSRC source file. If the sourc file name is *FROMSRC, and this parameter is blank, the library name specified on the FROMSRC parameter is used as the TOSRC libary.

To System

*LOCAL
If the TOSRC exists on the local IBM i system, specify *LOCAL for this portion of the TOSRC parameter.
remote-system-or-IP
Specify the remote system name or IP address where the TOSRC file exists.
Top

From member (FROMMBR)

Specify the source member being copied. This parameter can be generic and also supports *ALL.

This is a required parameter.

*ALL
All source file members in the FROMSRC file are copied to the TOSRC file.
*FIRST
The first source member in the FROMSRC is copied to the TOSRC file.
generic-name
Specify the generic name of the source members to be copied. Generic names are specified using an asterisk. For example FROMMBR(GLM*)
name
Specify the name of source member to be copied from the FROMSRC to the TOSRC source file.
Top

To member (TOMBR)

Specify the source member name in the TOSRC to receive the copy of the source member named on the FROMMBR parameter.

*FROMMBR
The TOMBR is uses the same name as the FROMMBR. This is required when FROMMBR contains a generic name or FROMMBR(*ALL) is specified.
name
Specify the name of target source file member.
Top

Replace or add records (MBROPT)

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.

*ADD
Records are added to the end of the TOMBR.
*REPLACE
To TOMBR is effectively cleared, and the copied records replace any existing records in the TOMBR.
Top

To Member SEU Source Type (SRCTYPE)

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.

*FROMMBR
The SEU Source Type is taken from the FROMMBR in the FROMSRC file.
name
Specify the SEU Source Type to assign to the target source file member.
Top
Top

Examples for CPYSRCRMT

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

Error messages

Unknown
Top