Save time and aggravation -- automate FTP data transfers

Tim Granatir, Search400.com expert

Tim Granatir

Sometimes it's the simple things that make the difference.

There are many techniques for transferring data from one machine to another. Some techniques have the advantage of security (tapes, CDs), but they take additional time in delivering the data. When time is critical, FTP offers a fast way to transfer data. Within the process of FTP data transfer, you can use several approaches with various degrees of automation.

The following is an example of automating the transfer of libraries from one iSeries to another by using batch files and your PC as an intermediate host. Generally, a PC is not required to be an intermediary in an FTP transfer between two iSeries, but there are some instances where it is necessary. The most common scenario is when the PC is the only link between two iSeries machines, such as using your local PC to dial in to a PPP line on another iSeries.

In this example, create a directory on the PC called FTPTMP that contains three batch files and also serves as a temporary holding place for a save file. The controlling batch file (GETSEND) calls a batch file (GETFROM) to save and retrieve all of the objects in a transfer library called XFER on the "from" iSeries and puts the save file into your PC directory. The second batch file (SENDTO) sends the save file to the receiving iSeries and restores all of the objects in the save file into a transfer library called XFER on the receiving machine.

The downside to this approach is that USERNAME and PASSWORD need to be replaced with the user name and password of the systems you are connecting. This could be a potential security exposure, which will need to be properly assessed and managed. Once managed, this can be a simple, handy and time-saving technique. In this case, an old-fashioned DOS batch file can still be an effective tool.

ftp -i -s:getfrom.bat
ftp -i -s:sendto.bat 

quote rcmd DLTF FILE(QGPL/FTP)
get qgpl/ftp.savf

quote rcmd CLRLIB LIB(XFER)
put ftp.savf XFER/FTP.SAVF

About the author: Tim is vice president of Technical Services at Interlink Technologies in Maumee, Ohio, where he serves as chief architect for their warehouse management system. He has worked in the banking, insurance, healthcare and distribution industries in various positions, including programmer/analyst, systems analyst and DP manager. Tim has worked on IBM midrange platforms since 1983.


  • Change FTP server to use port other than 21
    Everyone knows that port 21 is the default port for FTP servers. But what if you want to change the port number to make it more difficult for someone to gain unauthorized access to you FTP server? If you've tried to do so and failed, you may think that it's impossible to do. Not true. Search400 expert Tim Granatir knows a way, and he shares it here with you.
  • FTP save files GET as well as they PUT
    FTP isn't quite an exact science, and there's room for different ways for transferring files -- as many readers have pointed out. Writer Joe Hertvik used some of your feedback to his previous tip (Tricks and techniques for FTPing OS/400 save files) to dig even deeper into FTPing save files from one iSeries to another. What he provides here are tips for using the FTP GET sub-command, more information on using the PUT sub-command and details on naming formats when transferring files from the IFS.
  • Implementing FTP and ODBC security on the iSeries 400
    This Search400.com member is looking for suggestions for implementing FTP and ODBC security on the iSeries. According to security expert Carol Woodbury, exit program are essential.
  • FTP secrets revealed
    FTP is one of the top utilities for transferring data to and from the iSeries. Still, users often have problems using it. These resources reveal tips you may not have considered before.

This was first published in August 2002

There are Comments. Add yours.

TIP: Want to include a code block in your comment? Use <pre> or <code> tags around the desired text. Ex: <code>insert code</code>

REGISTER or login:

Forgot Password?
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
Sort by: OldestNewest

Forgot Password?

No problem! Submit your e-mail address below. We'll send you an email containing your password.

Your password has been sent to:

Disclaimer: Our Tips Exchange is a forum for you to share technical advice and expertise with your peers and to learn from other enterprise IT professionals. TechTarget provides the infrastructure to facilitate this sharing of information. However, we cannot guarantee the accuracy or validity of the material submitted. You agree that your use of the Ask The Expert services and your reliance on any questions, answers, information or other materials received through this Web site is at your own risk.