Problem solve Get help with specific problems with your technologies, process and projects.

Quickly copy an RPG or CL source member from one iSeries to another

Copying an RPG or CL program source from a remote iSeries into the iSeries you are currently on can be achieved using several ways. This tip review one of them.

Copying an RPG or CL program source from a remote iSeries into the iSeries you are currently on can be achieved...

using several ways. One way is by using Client Access data transfer. Another way is by using the iSeries SNDNETF command. But both take time.

The fastest way which I thought of and tried lately is by using two iSeries commands: CRTDDMF and CPYF.

The CRTDDMF command sets up a DDM file (a reference file) on the local system which can be used to access a file located on a remote system. A DDM file must contain the name of the remote file, the information identifying the remote system, and the method used to access the record(s) in the remote file. Below are examples of setting up DDM files:

CRTDDMF Example 1:

• CRTDDMF FILE(myLib/myDDMF) RMTFILE(rmtLib/rmtRPGSRC) RMTLOCNAME(rmtAS/400)

The above example shows setting up a DDM file by way of specifying the remote location name and uses the default remote address type of *SNA. It assumes that the DDM server at the remote location supports SNA connectivity.

Another way of setting up a DDM file is by specifying the remote IP address (nnn.nnn.nnn.nnn) for the remote location parameter. This form requires an address type of *IP and assumes that the DDM server at the remote location supports the use of TCP/IP.

CRTDDMF Example 2:

• CRTDDMF FILE(myLib/myDDMF) RMTFILE(rmtLib/rmtRPGSRC) RMTLOCNAME('123.456.789.123' *IP)

When the DDM file has been created, use the CPYF command to copy any or all members from a remote source physical file referenced by the DDM file.

CPYF Example:

• CPYF FROMFILE(myLib/myDDMF) TOFILE(myLib/myRPGSRC) FROMMBR(rmtMember) TOMBR(myMember) MBROPT(*ADD) FMTOPT(*NOCHK)

==================================
MORE INFORMATION ON THIS TOPIC
==================================

The Best Web Links: tips, tutorials and more.

Ask your programming questions--or help out your peers by answering them--in our live discussion forums.

Ask the Experts yourself: Our application development gurus are waiting to answer your programming questions.


This was last published in October 2004

Start the conversation

Send me notifications when other members comment.

By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Please create a username to comment.

-ADS BY GOOGLE

SearchDataCenter

Close